问题
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:
How to change user-agent in API 30?
回答1:
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
.
来源:https://stackoverflow.com/questions/62434410/set-user-agent-in-webview-for-android-api-30