0

After reading android user agent I set in WebView:

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

And loaded the URL "https://www.whoishostingthis.com/tools/user-agent/". In emulators of API 21 and 29 it worked right. But in API 30 it showed:

enter image description here

How to change user-agent in API 30?

CoolMind
  • 26,736
  • 15
  • 188
  • 224

1 Answers1

0

According to https://www.infoq.com/news/2020/03/chrome-phasing-user-agent/, Chrome will replace User-Agent with a new API called Client Hints.

CoolMind
  • 26,736
  • 15
  • 188
  • 224
  • according to https://www.chromium.org/updates/ua-reduction/#applicable-platforms, there are no any plans to ship this on iOS or Android WebView. – Cloud Chen Apr 17 '22 at 02:45