Page 1 of 1
Get useragent
Posted: Wed May 03, 2023 12:05 pm
by alpires2000
Hi Salvador.
In CEF4 I use GetDefaultCEFUserAgent to get useragent, is there any way to do this in WebView4?
Thanks
Re: Get useragent
Posted: Wed May 03, 2023 2:42 pm
by salvadordf
That function is not using any CEF API function. It just creates the user agent from scratch.
I don't recall any WebView2 API function to get that information at this moment but you can always get the user agent in JavaScript with this :
https://www.w3schools.com/jsref/prop_nav_useragent.asp
See the
BrowserHostAppCommunication demo to know how to send the "
agent" value to Delphi.