Fix pjax on iOS Simulator

The iOS 8.0 simulator on Mavericks contains the following in its
user-agent string: "iPhone; CPU iPhone OS 10_9_5 like Mac OS X"

The "OS 1" bit gets interpreted by our regex as if it were iOS 1.0 and
thus forcing pjax to be disabled since history manipulation APIs weren't
stable until iOS 5.0.

Close #19
Credits:
https://github.com/defunkt/jquery-pjax/commit/863b802a84af8a9c72def4984d
4d38163541fe6d
This commit is contained in:
Maxime Thirouin
2014-10-14 07:39:37 +02:00
parent ce28c1adc3
commit e0d33c9e18

View File

@@ -92,7 +92,7 @@
window.history.pushState &&
window.history.replaceState &&
// pushState isnt reliable on iOS until 5.
!navigator.userAgent.match(/((iPod|iPhone|iPad).+\bOS\s+[1-4]|WebApps\/.+CFNetwork)/)
!navigator.userAgent.match(/((iPod|iPhone|iPad).+\bOS\s+[1-4]\D|WebApps\/.+CFNetwork)/)
}
Pjax.forEachEls = function(els, fn, context) {