From 192e89671dc05b9c15291bb84dd1a85377f967ff Mon Sep 17 00:00:00 2001 From: Dwaipayan Date: Wed, 1 Mar 2017 14:29:09 +0530 Subject: [PATCH] modified : preferences.js The Clear rules button was not working. This patch clears the existing blacklist, except the default ones. fixes #102 --- src/js/preferences.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/js/preferences.js b/src/js/preferences.js index 80de876..5526b7e 100644 --- a/src/js/preferences.js +++ b/src/js/preferences.js @@ -171,13 +171,16 @@ function clearRules() { chrome.storage.local.get(['blacklist'], function(items) { var blacklist = items['blacklist']; - blacklist['SITE'] = ['chrome-ui://newtab'] - chrome.storage.local.set({'blacklist':null}); + blacklist['PAGE'] = ''; + blacklist['REGEX'] = ''; + blacklist['SITE'] = ''; + console.log(blacklist) + chrome.storage.local.set({'blacklist':blacklist}); }); notie.alert(1, 'Deleted Rules. Restarting WorldBrain...', 2) setTimeout(function() { - chrome.runtime.reload() - }, 2000); + chrome.runtime.reload() + }, 2000); } function clearHistory() {