]>
git.wh0rd.org - chrome-ext/clearhistory-advance-fork.git/blob - javascript/popup.js
2 * @fileoverview Executes when the user clicks the browser action.
5 import {CONSTANTS
} from './background.js';
7 async
function init() {
8 const {prompt
= CONSTANTS
.YES
} = await chrome
.storage
.sync
.get('prompt');
10 if (prompt
=== CONSTANTS
.YES
) {
11 // The confirmation message to ask.
12 const message
= chrome
.i18n
.getMessage('confirmPrompt');
14 if (!confirm(message
)) {
20 // Notify background page to do the actual clear.
21 await chrome
.runtime
.sendMessage({action
: 'runCleaner'});