summaryrefslogtreecommitdiffstats
path: root/theme/javascript/core
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2014-04-18 13:09:14 +0200
committerSamy Pessé <samypesse@gmail.com>2014-04-18 13:09:16 +0200
commite45bb84b023ca27b88f35da1566639166adbf63d (patch)
tree4cd6758dafafdd13420be61d948b75a121ad7ab6 /theme/javascript/core
parent4e8876c7255672146dd941f6b33b8010cb17b4e5 (diff)
downloadgitbook-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-xtheme/javascript/core/navigation.js4
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