Skip to content

Feature Request - Add the ability to automatically merge enable-features/disable-features command-line args with existing values #5244

@SLT-World

Description

@SLT-World

Is there an existing issue for this?

  • I have searched both open/closed issues, no issue already exists.

CefSharp Version

147.0.10

Operating System

Windows 11

Architecture

x64

.Net Version

.NET 8.0

Implementation

WPF HwndHost

Reproduction Steps

  • Configure CefSharp to use the Chrome runtime style: CefSharpSettings.RuntimeStyle = CefRuntimeStyle.Chrome;
  • Add a disable-features command-line argument, any value will crash the application: CefCommandLineArgs.Add("disable-features", "GlobalMediaControls");
  • Initialize CEF.
  • Create a ChromiumWebBrowser instance.
  • Crash observed.

Made a minimal reproducable repository demonstrating this issue: https://github.com/SLT-World/CefSharpRuntimeCrash/blob/main/MainWindow.xaml.cs

Expected behavior

The browser should not crash when using Chrome runtime style together with the disable-features flag.

Perhaps related, the supplied disable-features list should be merged, similar to the behavior observed in cefclient.exe in Other information below.

Actual behavior

When using the Chrome runtime style, adding any value to disable-features causes the application to crash during browser creation.

Issue appears to be specific to the Chrome runtime style and does not occur when using the Alloy runtime style. App manifest does not have an effect.

Additionally, the disable-features list are not merged correctly with an existing list. There are 2 completedly separate disable-features.

Image

Regression?

Unsure.

Known Workarounds

Avoid using the disable-features flag when running with the Chrome runtime style.

Using Alloy runtime style avoids the crash entirely, even with the disable-features flag.

Does this problem also occur in the CEF Sample Application

No

Other information

I was unable to replicate the issue with cefclient.exe on the same version 147.0.10 so I believe this may be a CefSharp issue.
I used the following command: cefclient.exe --multi-threaded-message-loop --no-sandbox --enable-chrome-runtime --disable-features=GlobalMediaControls.
I can assure that cefclient was running in Chrome runtime style as the chrome://extensions page exists.

Furthermore, in cefclient.exe, GlobalMediaControls is merged as --disable-features=GlicActorUi,AutofillActorMode,LensOverlay,GlobalMediaControls, seen in chrome://version.

Image

The existing disable-features seems to originate from https://github.com/chromiumembedded/cef/blob/58fa5d380aeaf56691ed5652ccec9386a7cc7d19/libcef/common/chrome/chrome_main_delegate_cef.cc#L357

Unfortunately, I lack the skills to further investigate or debug it myself beyond this point.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions