From 2f8b35365afebeae42e71fa4f658665877b1339b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20St=C3=B6r?= Date: Sun, 16 Apr 2017 20:31:38 +0200 Subject: [PATCH] Prevent determineSelectedLanguageCode() from failing for offline site --- docs/js/extra.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/js/extra.js b/docs/js/extra.js index 596fe815..665f3437 100644 --- a/docs/js/extra.js +++ b/docs/js/extra.js @@ -181,7 +181,7 @@ var nodemcu = nodemcu || {}; // path is like /en///build/ -> extract 'lang' // split[0] is an '' because the path starts with the separator selectedLanguageCode = path.split('/')[3]; - } else { + } else if (!window.location.href.startsWith('file://')) { // path is like //build/ -> extract 'lang' selectedLanguageCode = path.substr(1, 2); }