Javascript 每个版本的 iOS 都附带什么版本的移动 Safari?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8627968/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What version of mobile safari comes with each version of iOS?
提问by Mike Sherov
I'm trying to figure out what Javascript APIs I can use to achieve support for Mobile Safari back to iOS2. I haven't found a list anywhere that shows what version of Mobile Safari ships with each new version of iOS. I'm looking for a comprehensive list that goes all the way back to iOS2.
我试图弄清楚我可以使用哪些 Javascript API 来实现对 Mobile Safari 回 iOS2 的支持。我还没有在任何地方找到显示每个新版本 iOS 随附的 Mobile Safari 版本的列表。我正在寻找一个可以追溯到 iOS2 的综合列表。
Thanks!
谢谢!
[Edit: Yes, I know and love feature detection. However, I have a set of targeted browsers I need to support, and I just need to verify that the fallbacks I provided cover my target audience and that I don't need to provide additional fallbacks that are cumbersome hacks).]
[编辑:是的,我知道并喜欢特征检测。但是,我有一组我需要支持的目标浏览器,我只需要验证我提供的回退是否涵盖了我的目标受众,并且我不需要提供额外的麻烦的回退)。]
回答by Alex W
Since this is already the top hit on Google, we should start a list here. I'll make this answer a community wiki. By the way, I'm pulling these from the device's user agent string. Browser version is iOS version dependent, NOT device dependent. But when a phone doesn't support higher iOS versions it is listed:
由于这已经是谷歌上的热门,我们应该在这里开始一个列表。我会让这个答案成为社区维基。顺便说一下,我是从设备的用户代理字符串中提取这些内容的。浏览器版本取决于 iOS 版本,而不取决于设备。但是当手机不支持更高的 iOS 版本时,它会列出:
3.2.2 - Mobile Safari 4.0.4
4.3.3 - Mobile Safari 5.02 - iPhone 3g
5.0 - Mobile Safari 5.1
5.1 - Mobile Safari 5.1
6.0 - Mobile Safari 6.0 - iPhone 3gs
7.1 - Mobile Safari 7.1 - iPhone 4
8.3 - Mobile Safari 8.0
9.2.1 - Mobile Safari 9.0 - iPhone 4s
10.3.4 - Mobile Safari 10.0 - iPhone 5
11.2.5 - Mobile Safari 11.0
12.1.4 - Mobile Safari 12.0
12.4.4 - Mobile Safari 12.1 - iPhone 5S, 6
13.0 - Mobile Safari 13.0
回答by Izabela Ewe
This guy's list is really useful: http://www.somegeekintn.com/blog/stuff/iosvers/
这家伙的名单真的很有用:http: //www.somegeekintn.com/blog/stuff/iosvers/
If you need the additional info, you can decode the Safari versions on useragentstring.com, e.g:
如果您需要其他信息,您可以在 useragentstring.com 上解码 Safari 版本,例如:
http://www.useragentstring.com/Safari5.0.2_id_18120.phpexplains that Safari version 6533.18.5 is known as "Safari 5.0.2"
http://www.useragentstring.com/Safari5.0.2_id_18120.php解释说 Safari 版本 6533.18.5 被称为“Safari 5.0.2”
回答by Joel
I couldn't find a comprehensive list either. The best thing I've found so far is some Safari documentation from Apple:
我也找不到完整的列表。到目前为止,我发现的最好的东西是来自 Apple 的一些 Safari 文档:
Good luck!
祝你好运!
[Update]
[更新]
While this still doesn't answer the question it at least tells when WebKit added support for getBoundingClientRect()
in Febuary of 2009.
虽然这仍然没有回答这个问题,但它至少说明了 WebKitgetBoundingClientRect()
在 2009 年 2 月添加支持的时间。
回答by tkone
Rather than doing device or os detection, you should be doing feature detection -- it'll provide a much richer experience, and you can provide custom code to add functionality that the specific version doesn't support. This way you'll provide support way beyond the specific devices you're targeting (and it usually ends up being easier since rather than branching your code for a specific user-agent, you're back-filling support for older js implementations by providing forward-looking support on a conditional basis).
您应该进行功能检测,而不是进行设备或操作系统检测——它会提供更丰富的体验,并且您可以提供自定义代码来添加特定版本不支持的功能。通过这种方式,您将提供超出您所针对的特定设备的支持方式(并且通常最终会更容易,因为您不是为特定的用户代理分支代码,而是通过提供对旧的 js 实现的回填支持有条件的前瞻性支持)。
For example, the latest version of desktop & mobile Safari do not provide .bind()
functionality to bind a context to a closure. This can be detected and handled using Function.prototype.bind
and if it doesn't exist, providing an implementation that provides the functionality to older browsers. Using a library like http://www.modernizr.com/will assist greatly in this endeavor.
例如,最新版本的桌面和移动 Safari 不提供.bind()
将上下文绑定到闭包的功能。这可以被检测和处理Function.prototype.bind
,如果它不存在,则提供一个为旧浏览器提供功能的实现。使用像http://www.modernizr.com/这样的库将大大有助于这项工作。
That being said there are some specific DOM events which are tied to certain versions of iOS: http://developer.apple.com/library/safari/navigation/#section=Libraries&topic=Safari%20DOM%20Additions%20for%20iOS
也就是说,有一些特定的 DOM 事件与特定版本的 iOS 相关:http: //developer.apple.com/library/safari/navigation/#section=Libraries&topic=Safari%20DOM%20Additions%20for%20iOS
回答by frosty
If there are specific API's that you are looking at, caniuse.com is a great resource for finding out how far back the API has support.
如果您正在查看特定的 API,caniuse.com 是一个很好的资源,可帮助您了解该 API 的支持时间。
Good luck with it!
祝你好运!