X-Git-Url: https://git.wh0rd.org/?p=chrome-ext%2Fclearhistory-advance-fork.git;a=blobdiff_plain;f=javascript%2Fclearhistory.js;h=3766f6bf83e3a3d1adc440a3838e9f3b1f6b652e;hp=d73827a7e57aed5349752130ab9baa38eea0044b;hb=77dffdcdb7a4c632fd98c566eb2b3f487f6efb0e;hpb=e70bcd55897cb58bc2f632a46f6e88827dcdb04a diff --git a/javascript/clearhistory.js b/javascript/clearhistory.js index d73827a..3766f6b 100644 --- a/javascript/clearhistory.js +++ b/javascript/clearhistory.js @@ -89,14 +89,19 @@ function clearHistory() { chrome.browserAction.onClicked.addListener(function(tab) { // Get the value from localStorage var showPrompt = localStorage['prompt'] || CONSTANTS.YES; + var clearCookies = localStorage['cookies'] || CONSTANTS.NO; // The confirmation message to ask var message = chrome.i18n.getMessage('confirmPrompt'); // Clear cookies, and then clear the history if (showPrompt === CONSTANTS.YES) { - confirm(message) && clearCookies(clearHistory); - } else { + if (!confirm(message)) + return; + } + if (clearCookies === CONSTANTS.YES) { clearCookies(clearHistory); + } else { + clearHistory(); } });