Welcome Guest Search | Active Topics | Sign In | Register

Changing ua in the BeforeRequestLoad event, not changed in navigator.userAgent Options
mose.jeziel
Posted: Thursday, August 15, 2024 4:22:40 AM
Rank: Member
Groups: Member

Joined: 8/10/2023
Posts: 27
After changing the UserAgent in the BeforeRequestLoad event, it was found that the result of webView.EvalScript("navigator.userAgent") has not changed, but the network request in the debugging console has changed.

Code: C#
private void webView1_BeforeRequestLoad(object sender, BeforeRequestLoadEventArgs e)
{
    e.Request.Headers["User-Agent"] = "test";
}



How do I get a new UserAgent?
eo_support
Posted: Thursday, August 15, 2024 1:25:57 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Hi,

You would change your user agent through this property:

https://www.essentialobjects.com/doc/eo.webengine.engineoptions.customuseragent.html

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.