avm99963 | 3a4946d | 2021-02-05 21:27:12 +0100 | [diff] [blame] | 1 | // IMPORTANT: keep this file in sync with sw.js |
| 2 | |
avm99963 | 4c1a679 | 2020-08-31 21:30:42 +0200 | [diff] [blame] | 3 | // When the extension gets updated, set new options to their default value. |
avm99963 | 122dc9b | 2019-03-30 18:44:18 +0100 | [diff] [blame] | 4 | chrome.runtime.onInstalled.addListener(function(details) { |
avm99963 | b69eb3d | 2020-08-20 02:03:44 +0200 | [diff] [blame] | 5 | if (details.reason == 'install' || details.reason == 'update') { |
avm99963 | 4c1a679 | 2020-08-31 21:30:42 +0200 | [diff] [blame] | 6 | chrome.storage.sync.get(null, function(options) { |
avm99963 | bf8eece | 2021-04-22 00:27:03 +0200 | [diff] [blame] | 7 | cleanUpOptions(options, false); |
avm99963 | 4c1a679 | 2020-08-31 21:30:42 +0200 | [diff] [blame] | 8 | }); |
avm99963 | 122dc9b | 2019-03-30 18:44:18 +0100 | [diff] [blame] | 9 | } |
avm99963 | cbea314 | 2019-03-28 00:48:15 +0100 | [diff] [blame] | 10 | }); |
avm99963 | 1a1d2b7 | 2020-08-20 03:15:20 +0200 | [diff] [blame] | 11 | |
| 12 | chrome.browserAction.onClicked.addListener(function() { |
| 13 | chrome.runtime.openOptionsPage(); |
| 14 | }); |