diff options
author | Samy Pessé <samypesse@gmail.com> | 2014-04-18 13:09:14 +0200 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2014-04-18 13:09:16 +0200 |
commit | e45bb84b023ca27b88f35da1566639166adbf63d (patch) | |
tree | 4cd6758dafafdd13420be61d948b75a121ad7ab6 /theme/javascript/core | |
parent | 4e8876c7255672146dd941f6b33b8010cb17b4e5 (diff) | |
download | gitbook-e45bb84b023ca27b88f35da1566639166adbf63d.zip gitbook-e45bb84b023ca27b88f35da1566639166adbf63d.tar.gz gitbook-e45bb84b023ca27b88f35da1566639166adbf63d.tar.bz2 |
Fix navigation on chrome for iOS: disable pushState
Diffstat (limited to 'theme/javascript/core')
-rwxr-xr-x | theme/javascript/core/navigation.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/theme/javascript/core/navigation.js b/theme/javascript/core/navigation.js index 1b51907..baf53e7 100755 --- a/theme/javascript/core/navigation.js +++ b/theme/javascript/core/navigation.js @@ -10,12 +10,14 @@ define([ var prev, next; var githubCountStars, githubCountWatch; + var usePushState = !navigator.userAgent.match('CriOS') && (typeof history.pushState !== "undefined"); + var updateHistory = function(url, title) { history.pushState({ path: url }, title, url); }; var handleNavigation = function(url, push) { - if (typeof history.pushState === "undefined") { + if (!usePushState) { // Refresh the page to the new URL if pushState not supported location.href = url; return |