none
get default useragent string used in WinRT Webview

    Question

  • How could I get the useragent string used by default with WinRT Webview?

    I could only figure out that I could set it by using NavigateWithHttpRequest

    Wednesday, March 13, 2019 1:50 PM

All replies

  • Hi,

    As I know, you could call javascript function navigator.userAgent to get the default useragent. You could inject some javascript code to the webview and then use window.external.notify to pass the value out of the webview and use it in your project. For more information, please refer:How to get default User-Agent? and Interacting with WebView content.

    Best regards,

    Roy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, March 14, 2019 8:41 AM
    Moderator