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