From e3dd72d27b24168db3057a609af9884de5f10da4 Mon Sep 17 00:00:00 2001 From: Rochet2 Date: Sat, 19 Mar 2016 19:35:37 +0200 Subject: [PATCH] Disable history when browsing files locally http://stackoverflow.com/a/32454237/3586583 --- docs/ElunaDoc/static/main.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/ElunaDoc/static/main.js b/docs/ElunaDoc/static/main.js index 7e3720c..928e9e6 100644 --- a/docs/ElunaDoc/static/main.js +++ b/docs/ElunaDoc/static/main.js @@ -530,7 +530,9 @@ // Because searching is incremental by character, only the most // recent search query is added to the browser history. - if (browserSupportsHistoryApi()) { + // Do not do this on local due to chrome security errors. + // http://stackoverflow.com/a/32454237/3586583 + if (browserSupportsHistoryApi() && window.location.protocol != "file:") { if (!history.state && !params.search) { history.pushState(query, "", "?search=" + encodeURIComponent(query.query)); @@ -779,4 +781,4 @@ $("#main > .docblock").before(wrapper); }); -}()); \ No newline at end of file +}());