在 iOS 中使用 WKWebView 请求桌面站点 [英] Request desktop sites using WKWebView in iOS
本文介绍了在 iOS 中使用 WKWebView 请求桌面站点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我四处搜索,但找不到不依赖网站本身(他们自己的桌面版"按钮)来请求桌面版网站的方法.
I searched all around but cannot find a way to request the desktop versions of websites without relying on the sites themselves (their own "desktop version" buttons).
有没有办法做到这一点?我想如果我可以让它在 UIWebView 中工作,它可以在 WKWebView 上以相同的方式完成.
Is there a way to do this? I think if I can get it to work in a UIWebView, it could be done the same way on a WKWebView.
推荐答案
可能与用户代理:
NSUserDefaults.standardUserDefaults().registerDefaults(["UserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/7046A194A"])
我从以下来源找到了用户代理字符串:http://www.useragentstring.com/pages/Safari/
I found the useragent string from this source: http://www.useragentstring.com/pages/Safari/
这篇关于在 iOS 中使用 WKWebView 请求桌面站点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文