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