chromiumembedded / cef

Chromium Embedded Framework (CEF). A simple framework for embedding Chromium-based browsers in other applications.
https://bitbucket.org/chromiumembedded/cef/
Other
3.38k stars 467 forks source link

Add ability to configure navigator.userAgentData.brands at runtime #3770

Closed BrianAndersonMozenda closed 1 month ago

BrianAndersonMozenda commented 3 months ago

Describe the bug Because the navigator.userAgentData.brands is a internal readonly property it can't be overridden to be able to create a brand browser.

To Reproduce Steps to reproduce the behavior:

  1. Open cefclient
  2. Open DevTools
  3. Open the Console
  4. Type "navigator.userAgentData"
  5. Note that the default readonly property is returned

Expected behavior Have the ability to override the brands property similar to Brave, Chrome, and Edge. We provide a pseudo-browser to our customers and we would like to be able to override these properties.

https://developer.mozilla.org/en-US/docs/Web/API/NavigatorUAData

Screenshots image

magreenblatt commented 3 months ago

Branding is a compile-time value from chrome/app/theme/chromium/BRANDING. Currently, you will need to generate your own custom CEF/Chromium builds to configure this.

The NavigatorUIData is populated via GetUserAgentMetadata, so it may also be possible to configure this particular value at runtime with Chromium code changes.

amaitland commented 3 months ago

The following might be worth a try

https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#type-UserAgentBrandVersion