avm99963 | 3a4946d | 2021-02-05 21:27:12 +0100 | [diff] [blame] | 1 | // IMPORTANT: keep this file in sync with background.js |
| 2 | |
avm99963 | bbc88c6 | 2020-12-25 03:44:41 +0100 | [diff] [blame] | 3 | importScripts('common/common.js') |
| 4 | |
| 5 | // When the extension gets updated, set new options to their default value. |
| 6 | chrome.runtime.onInstalled.addListener(details => { |
| 7 | if (details.reason == 'install' || details.reason == 'update') { |
| 8 | chrome.storage.sync.get(null, options => { |
avm99963 | bf8eece | 2021-04-22 00:27:03 +0200 | [diff] [blame] | 9 | cleanUpOptions(options, false); |
avm99963 | bbc88c6 | 2020-12-25 03:44:41 +0100 | [diff] [blame] | 10 | }); |
| 11 | } |
| 12 | }); |
| 13 | |
| 14 | chrome.action.onClicked.addListener(_ => { |
| 15 | chrome.runtime.openOptionsPage(); |
| 16 | }); |