Force webview to display desktop sites

后端 未结 3 2104
悲&欢浪女
悲&欢浪女 2020-12-11 07:05

I have the below webview client which sets the user agent to a desktop browser when we are viewing a page that does not contain the word google in the URL. (Also does other

3条回答
  •  不思量自难忘°
    2020-12-11 07:47

    You can use setDesktopMode(true) from this WebView subclass or read how it's implemented in detail.

    This way, you don't have to set a fixed user-agent string. Moreover, setting the user-agent string only is usually not enough. It depends on the site, of course, since every website uses their own way of determining whether the client is on mobile or desktop.

提交回复
热议问题