chromiumembedded / cef

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

How to set default language and theme for devtools? #3334

Closed magreenblatt closed 2 years ago

magreenblatt commented 2 years ago

Original report by Sida Lu (Bitbucket: Sida Lu).


When I call ShowDevToolsDocked to open the devtools panel, it always prompts "Always match Chrome^s language", and the current language setting will not be automatically applied. How can I set the default language and theme for devtools?

magreenblatt commented 2 years ago

It looks like you're using CefSharp. Please ask your question in an appropriate support channel.

magreenblatt commented 2 years ago

Original comment by Alex Maitland (Bitbucket: a-maitland).


Starting with version 94 DevTools supports different languages https://developer.chrome.com/blog/new-in-devtools-94/#localized

A quick test suggests the alloy runtime requires changes to support (or disable) this feature.

magreenblatt commented 2 years ago

Original comment by Sida Lu (Bitbucket: Sida Lu).


I want to know how to automatically set the language and theme by calling ShowDevToolsDocked to open the devtools panel, instead of manually going to the settings panel to switch languages and themes!

magreenblatt commented 2 years ago

Original comment by Alex Maitland (Bitbucket: Alex Maitland).


CEF doesn’t yet support localized DevTools. Support would need to be added for this to work.

- Download cef_binary_102.0.6+g4209780+chromium-102.0.5005.61_windows64_beta_client.tar.bz2
- Extract
- Run cefclient.exe --lang=fr_fr
- Open DevTools (right click)
- Click Switch DevTools to French (Same happens for (Always match Chromes langauge)
- DevTools goes blank 

Errors in Log

[0524/143832.206:ERROR:CONSOLE(1)] "This is a stub connection, can't dispatch message.", source: devtools://devtools/core/sdk/sdk.js (1)
[0524/143832.264:ERROR:CONSOLE(1)] "This is a stub connection, can't dispatch message.", source: devtools://devtools/core/sdk/sdk.js (1)
[0524/143841.922:ERROR:CONSOLE(1)] "TypeError: Failed to fetch", source: devtools://devtools/entrypoints/main/main.js (1)

I tried to test with Chrome Runtime, clicking Inspect doesn’t appear to open DevTools currently.

magreenblatt commented 2 years ago

Original comment by Alex Maitland (Bitbucket: a-maitland).


Can this be reopened please? Possibly renamed to Add support for localized DevTools.

If support isn’t going to be added then perhaps we can disable the prompts to switch language.

magreenblatt commented 2 years ago