【问题标题】:Set user-agent in WebView for Android, API 30在 WebView for Android,API 30 中设置用户代理
【发布时间】:2020-06-17 16:59:42
【问题描述】:

看完android user agent我在WebView中设置:

webView.settings.apply {
    userAgentString = "some string"
    javaScriptEnabled = true
    javaScriptCanOpenWindowsAutomatically = true
    domStorageEnabled = true
}

并加载了 URL“https://www.whoishostingthis.com/tools/user-agent/”。在 API 21 和 29 的模拟器中,它运行良好。但在 API 30 中显示:

如何在 API 30 中更改用户代理?

【问题讨论】:

    标签: android android-webview user-agent


    【解决方案1】:

    根据https://www.infoq.com/news/2020/03/chrome-phasing-user-agent/,Chrome 将用一个名为Client Hints 的新API 替换User-Agent

    【讨论】:

      猜你喜欢
      • 2023-03-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-09-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多