获取WinRT Webview中使用的默认useragent字符串 [英] get default useragent string used in WinRT Webview

查看:52
本文介绍了获取WinRT Webview中使用的默认useragent字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎样才能获得WinRT Webview默认使用的useragent字符串?


我只能弄明白我可以使用 Navigate 来设置它用 Http 请求


解决方案


据我所知,您可以调用javascript函数navigator.userAgent来获取默认的useragent。您可以向webview注入一些javascript代码,然后使用  window.external.notify将值传递出webview并在项目中使用它。
欲了解更多信息,请参阅:如何获取默认的User-Agent? &absp; 使用WebView内容与
进行交互


祝你好运,


罗伊


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

解决方案

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


这篇关于获取WinRT Webview中使用的默认useragent字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆