From 71f6ea9e7e10f2f4a4eebe09246167ee21118b74 Mon Sep 17 00:00:00 2001 From: Pierre Boyer Date: Mon, 11 Apr 2016 13:52:11 +0200 Subject: [PATCH] Don't use localStorage by default --- src/content.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/content.js b/src/content.js index f003c0b..74aaa0f 100755 --- a/src/content.js +++ b/src/content.js @@ -3,9 +3,9 @@ var rules, domain, locale, root; function start() { - if(!window.localStorage["rules"]) window.localStorage["rules"] = JSON.stringify(defaultRules); + window.forkRulesLocally = () => window.localStorage["rules"] = JSON.stringify(defaultRules); - rules = JSON.parse(window.localStorage["rules"]); + rules = window.localStorage["rules"] ? JSON.parse(window.localStorage["rules"]) : defaultRules; domain = window.location.pathname.substring(6); // Substring 6 turns (developer.mozilla.org)/en-US/docs/* into simply /docs/*, for scoping // The locale can be determined from either a hidden input on the page or from the language selector