From e0d33c9e18ed542cd22c5cab74ae8c0619822e22 Mon Sep 17 00:00:00 2001 From: Maxime Thirouin Date: Tue, 14 Oct 2014 07:39:37 +0200 Subject: [PATCH] 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 --- src/pjax.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pjax.js b/src/pjax.js index 963d683..cccfc2e 100644 --- a/src/pjax.js +++ b/src/pjax.js @@ -92,7 +92,7 @@ window.history.pushState && window.history.replaceState && // pushState isn’t 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) {