blob: b8dccf2b3dbc4a6fa991e104d3b168f10fccd92c [file] [log] [blame]
avm999633a4946d2021-02-05 21:27:12 +01001// IMPORTANT: keep this file in sync with background.js
Adrià Vilanova Martínez3465e772021-07-11 19:18:41 +02002import {cleanUpOptions} from './common/optionsUtils.js'
avm99963bbc88c62020-12-25 03:44:41 +01003
4// When the extension gets updated, set new options to their default value.
5chrome.runtime.onInstalled.addListener(details => {
6 if (details.reason == 'install' || details.reason == 'update') {
7 chrome.storage.sync.get(null, options => {
avm99963bf8eece2021-04-22 00:27:03 +02008 cleanUpOptions(options, false);
avm99963bbc88c62020-12-25 03:44:41 +01009 });
10 }
11});
12
13chrome.action.onClicked.addListener(_ => {
14 chrome.runtime.openOptionsPage();
15});