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

how to change user agent in loaded WebView #327

Closed
kitUIN opened this issue Jan 3, 2024 · 1 comment
Closed

how to change user agent in loaded WebView #327

kitUIN opened this issue Jan 3, 2024 · 1 comment

Comments

@kitUIN
Copy link

kitUIN commented Jan 3, 2024

WebView.Settings.UserAgent = "xxx";

but it not run

Unhandled exception. System.InvalidOperationException: Cannot set UserAgent after WebView engine has been loaded
@kitUIN kitUIN changed the title how to change user agent in loaded WeB how to change user agent in loaded WebView Jan 3, 2024
@joaompneves
Copy link
Collaborator

Hi,

Tried the following, but doesn't work.

    webview.BeforeNavigate += request => request.SetHeaderByName("User-Agent", "Custom", true);

That's likely a CEF issue, so i recommend that you look in their forum.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants