Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TChromiumCore.AcceptLanguageList not working in recent Chromium versions #543

Open
salvadordf opened this issue Jan 19, 2025 · 5 comments
Open
Labels
bug upstream Issue in the CEF libraries

Comments

@salvadordf
Copy link
Owner

The TChromiumCore.AcceptLanguageList property sets the new value in the browser preferences correctly but it's ignored by Chromium recently.

The Browser.Host.RequestContext.CanSetPreference function returns true and the new value seems to be set but Chromium overrides it with the default GlobalCEFApp.AcceptLanguageList value.

Some browser preferences are not used by Chromium and we can only read them.

Using the TChromiumCore.OnBeforeResourceLoad event to replace the "Accept-Language" HTTP header might be a workaround.

See the discussion here

@salvadordf salvadordf added bug upstream Issue in the CEF libraries labels Jan 19, 2025
@salvadordf
Copy link
Owner Author

After further testing, the TChromiumCore.AcceptLanguageList property seems to work fine as long as it's set after creating the browser. The browser cache has to be cleared to see the results in some cases.

Navigate to this website to test this property.

Tested using the menu option to change the Accept Language List in the MiniBrowser demo and CEF 132.3.1.

GlobalCEFApp.AcceptLanguageList also works correctly.

@SteIngODF
Copy link

Hi, since CEF version 127 we have had a problem with Accept-Language.

I just carried out the test with Cef version 132 and the mini browser. After changing the Accept Language via the menu options, the set Accept Language is only used the first time. If the page is reloaded, the default "en-US" is used instead of Accept-Language.

@salvadordf
Copy link
Owner Author

I'll check this issue again as soon as I can. Meanwhile, use the GlobalCEFApp.AcceptLanguageList property.

@salvadordf
Copy link
Owner Author

I tried to reproduce this issue navigating to several websites and reloading the site in the previous link several times and I can't reproduce it in my computer.

I used 'it' (Italian) as the TChromiumCore.AcceptLanguageList property value in the MiniBrowser tests. I always saw the 'it' ACCEPT-LANGUAGE header in whatismybrowser.com

I'll reopen this issue anyway.

@salvadordf salvadordf reopened this Feb 9, 2025
@SteIngODF
Copy link

Hi,

I tested this again on myself. My surroundings:

CEF4Delphi: Master with cef_binary_132.3.2

  • Delphi 12.2, Windows version 11
  • Delphi 10.3, Windows version 10

Reproduced with "Mini-Browser" sample

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug upstream Issue in the CEF libraries
Projects
None yet
Development

No branches or pull requests

2 participants