-chrome.browserAction.onClicked.addListener(function(tab) {
- // Get the value from localStorage
- chrome.storage.sync.get('prompt', function(s) {
- var showPrompt = s.prompt || CONSTANTS.YES;
-
- // The confirmation message to ask
- var message = chrome.i18n.getMessage('confirmPrompt');
-
- // Clear cookies, and then clear the history
- if (showPrompt === CONSTANTS.YES) {
- if (!confirm(message))
- return;
+chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) {
+ switch (request?.action) {
+ case 'runCleaner':
+ runCleaner();
+ break;