--- /dev/null
+/**
+ * @fileoverview Executes when the user clicks the browser action.
+ */
+
+import {CONSTANTS} from './background.js';
+
+async function init() {
+ const {prompt = CONSTANTS.YES} = await chrome.storage.sync.get('prompt');
+
+ if (prompt === CONSTANTS.YES) {
+ // The confirmation message to ask.
+ const message = chrome.i18n.getMessage('confirmPrompt');
+
+ if (!confirm(message)) {
+ window.close();
+ return;
+ }
+ }
+
+ // Notify background page to do the actual clear.
+ await chrome.runtime.sendMessage({action: 'runCleaner'});
+
+ window.close();
+}
+init();