Skip to content

Commit 863b802

Browse files
committed
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. Fixes #443
1 parent e3a93c9 commit 863b802

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

jquery.pjax.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,7 @@ if ( $.inArray('state', $.event.props) < 0 )
865865
$.support.pjax =
866866
window.history && window.history.pushState && window.history.replaceState &&
867867
// pushState isn't reliable on iOS until 5.
868-
!navigator.userAgent.match(/((iPod|iPhone|iPad).+\bOS\s+[1-4]|WebApps\/.+CFNetwork)/)
868+
!navigator.userAgent.match(/((iPod|iPhone|iPad).+\bOS\s+[1-4]\D|WebApps\/.+CFNetwork)/)
869869

870870
$.support.pjax ? enable() : disable()
871871

0 commit comments

Comments
 (0)