Does UIWebView send the same User-Agent in the Request Headers as mobile Safari?(UIWebView 是否在请求标头中发送与移动 Safari 相同的用户代理?)
问题描述
抱歉,我只是自己测试一下,但我目前没有我的 mac.在 UIWebView 内发出的 Web 请求是否发送与从移动 Safari 发出的 Web 请求相同的用户代理信息?
Sorry, I would just test this myself, but I'm currently without my mac. Does a web request made inside of a UIWebView send the same user-agent info that a web request made from mobile Safari would?
推荐答案
从 UIWebView 发出的 Web 请求不会在用户代理字符串中包含单词Safari".从 Mobile Safari 发出的 Web 请求会.这是我发现的确定请求来自应用程序内部还是来自 Mobile Safari 的最佳方式.
Web requests made from UIWebView will not include the word "Safari" in the User Agent string. Web requests made from Mobile Safari will. This is the best way I have found for determining of a request is coming from within an app or from Mobile Safari.
来自 App 内 UIWebView 的用户代理示例:
Sample User Agent from UIWebView within App:
User-Agent: Mozilla/5.0 (iPad; U; CPU OS 4_3_2 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Mobile
Mobile Safari 的用户代理示例:
Sample User Agent from Mobile Safari:
User-Agent: Mozilla/5.0 (iPad; U; CPU OS 4_3_2 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8H7 Safari
这篇关于UIWebView 是否在请求标头中发送与移动 Safari 相同的用户代理?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:UIWebView 是否在请求标头中发送与移动 Safari 相同的用户代理?


基础教程推荐
- 使用 Ryzen 处理器同时运行 WSL2 和 Android Studio 2022-01-01
- LocationClient 与 LocationManager 2022-01-01
- Android文本颜色不会改变颜色 2022-01-01
- 固定小数的Android Money Input 2022-01-01
- “让"到底是怎么回事?关键字在 Swift 中的作用? 2022-01-01
- 如何使用 YouTube API V3? 2022-01-01
- Android ViewPager:在 ViewPager 中更新屏幕外但缓存的片段 2022-01-01
- :hover 状态不会在 iOS 上结束 2022-01-01
- 如何使 UINavigationBar 背景透明? 2022-01-01
- 在 iOS 上默认是 char 签名还是 unsigned? 2022-01-01