diff --git a/chromium/background-scripts/background.js b/chromium/background-scripts/background.js index 9e8392a773ec..40ccdd146784 100644 --- a/chromium/background-scripts/background.js +++ b/chromium/background-scripts/background.js @@ -713,6 +713,16 @@ chrome.runtime.onMessage.addListener(function(message, sender, sendResponse){ sendResponse(true); }); return true; + } else if (message.type == "reset_to_defaults") { + // restore the 'default states' of the rulesets + store.set_promise('ruleActiveStates', {}).then(() => { + // clear the caches such that it becomes stateless + destroy_caches(); + // re-activate all rules according to the new states + initializeAllRules(); + // reload tabs when operations completed + chrome.tabs.reload(); + }); } else if (message.type == "add_new_rule") { all_rules.addNewRuleAndStore(message.object).then(() => { sendResponse(true); diff --git a/chromium/pages/popup/index.html b/chromium/pages/popup/index.html index 5dbd92ad9faa..21dac9971bb7 100644 --- a/chromium/pages/popup/index.html +++ b/chromium/pages/popup/index.html @@ -59,6 +59,10 @@

+ +
+ +