OutSystems / WebView

Avalonia/WPF control that wraps CefGlue webview control
Apache License 2.0
310 stars 38 forks source link

how to change user agent in loaded WebView #327

Closed kitUIN closed 5 months ago

kitUIN commented 6 months ago
WebView.Settings.UserAgent = "xxx";

but it not run

Unhandled exception. System.InvalidOperationException: Cannot set UserAgent after WebView engine has been loaded
joaompneves commented 6 months ago

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.