blob: 15f62b9cd60148ce325b433b9cdf36b29c6e87f0 [file] [log] [blame]
avm999633a4946d2021-02-05 21:27:12 +01001// IMPORTANT: keep this file in sync with sw.js
Adrià Vilanova Martínez3465e772021-07-11 19:18:41 +02002import {cleanUpOptions} from './common/optionsUtils.js'
avm999633a4946d2021-02-05 21:27:12 +01003
avm999634c1a6792020-08-31 21:30:42 +02004// When the extension gets updated, set new options to their default value.
avm99963122dc9b2019-03-30 18:44:18 +01005chrome.runtime.onInstalled.addListener(function(details) {
avm99963b69eb3d2020-08-20 02:03:44 +02006 if (details.reason == 'install' || details.reason == 'update') {
avm999634c1a6792020-08-31 21:30:42 +02007 chrome.storage.sync.get(null, function(options) {
avm99963bf8eece2021-04-22 00:27:03 +02008 cleanUpOptions(options, false);
avm999634c1a6792020-08-31 21:30:42 +02009 });
avm99963122dc9b2019-03-30 18:44:18 +010010 }
avm99963cbea3142019-03-28 00:48:15 +010011});
avm999631a1d2b72020-08-20 03:15:20 +020012
13chrome.browserAction.onClicked.addListener(function() {
14 chrome.runtime.openOptionsPage();
15});