The following forum(s) are migrating to a new home on Microsoft Q&A (Preview): Developing Universal Windows apps!

Ask new questions on Microsoft Q&A (Preview).
Interact with existing posts until December 13, 2019, after which content will be closed to all new and existing posts.

Learn More

 none
get default useragent string used in WinRT Webview RRS feed

  • 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.

    • Proposed as answer by Barry Wang Wednesday, March 20, 2019 9:46 AM
    Thursday, March 14, 2019 8:41 AM
    Moderator
  • Using the code you link to on the MSDN forums, this seems to cause a lot of hangs when your build min is 1803 and max 1903.  We were using this for 3 years, but after updating our app to use Fluent design with the specific min max, users experience frequent hangs on desktops and occasionally on Xbox One.
    Tuesday, July 16, 2019 8:49 PM