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();
}
});