avm99963 | cbea314 | 2019-03-28 00:48:15 +0100 | [diff] [blame^] | 1 | function isEmpty(obj) { |
2 | return Object.keys(obj).length === 0; | ||||
3 | } | ||||
4 | |||||
5 | chrome.runtime.onInstalled.addListener(function(details) { | ||||
6 | chrome.storage.sync.get(null, function(items) { | ||||
7 | if (details.reason == "install") { | ||||
8 | if (isEmpty(items)) { | ||||
9 | chrome.storage.sync.set({"list": true, "thread": true}); | ||||
10 | } | ||||
11 | } | ||||
12 | }); | ||||
13 | }); |