如何用电脑打开UIWebview的网站?

How to open a website on UIWebview as computer?

在 Google Chrome 上有这个选项 "Website for computer"。许多网站识别出您使用的是移动设备 phone,它们会将您重定向到另一个专为移动设备设计的网站。

我只需要不让他们认出我正在使用来自 IOS 的 UIWebview。

我想你可以通过 changing the user agent 获得这种效果。

这应该适用于大多数网站,除非他们真的很认真地尝试检测移动设备(通过检查 window 大小等)。

我用这个解决了:

NSDictionary *dictionary = [NSDictionary dictionaryWithObjectsAndKeys:@"Your user agent", @"UserAgent", nil];
[[NSUserDefaults standardUserDefaults] registerDefaults:dictionary];