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

Setting CoreWebView2EnvironmentOptions Language property doesn't change accept-language http header #3635

Closed
jebihug opened this issue Jul 12, 2023 · 5 comments
Assignees
Labels
bug Something isn't working tracked We are tracking this work internally.

Comments

@jebihug
Copy link

jebihug commented Jul 12, 2023

Description
Setting CoreWebView2EnvironmentOptions Language property doesn't change accept-language http header unless you delete the Preferences file or use a new userDataFolder path.

As reported in #833

Version
Runtime: 114.0.1823.79
Framework: Win32
OS: Win10

AB#45519111

@jebihug jebihug added the bug Something isn't working label Jul 12, 2023
@LiangTheDev LiangTheDev added the tracked We are tracking this work internally. label Jul 13, 2023
@LiangTheDev
Copy link
Member

That's the current behavior. I created an internal work item to track the issue. We'll either update the document or make it work as expected.

At the mean time, could you try to use --accept-lang command line switch to see whether it works? Something like ICoreWebView2EnvironmentOptions::put_AdditionalBrowserArguments(L”--accept-lang=es-MX”);

@jebihug
Copy link
Author

jebihug commented Jul 14, 2023

Indeed, this works. I can set the accept languages list at initialization using the switch "accept-lang".
By the way, the "accept-language" http header seems to be "calculated" using the concatenation of the "lang" and "accept-lang" switches. Good.
Nevertheless it is not possible to change neither the lang or the accept-lang after initialisation.
Using Edge, if I change my parameter "Preferred languages" I can immediatly see the change in the "accept-language" http header.

@victorhuangwq
Copy link
Collaborator

#3302 @olegsavelos Do you think this is relevant?

@champnic
Copy link
Member

champnic commented Nov 2, 2023

Fixed in runtime versions 118.0.2061.0+. Thanks!

@champnic champnic closed this as completed Nov 2, 2023
@olegsavelos
Copy link

#3302 @olegsavelos Do you think this is relevant?

If the fix involves forwarding WM_INPUTLANGCHANGE to the WebView WPF host window then yes, I made a workaround by periodically checking Chrome_SystemMessageWindow of web view with GetKeyboardLayout in order to be able to understand when the input language have changed so if you fixed that then great and I can get rid of this small hack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working tracked We are tracking this work internally.
Projects
None yet
Development

No branches or pull requests

5 participants