-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbackground.js
More file actions
19 lines (17 loc) · 770 Bytes
/
Copy pathbackground.js
File metadata and controls
19 lines (17 loc) · 770 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* Compass Toolkit: service worker.
*
* There is very little to do here: features run in content scripts and read
* their own settings, and captured data goes straight to chrome.storage. This
* only seeds the defaults on install so the popup opens with real values
* rather than an empty object.
*/
importScripts("src/shared/settings.js");
chrome.runtime.onInstalled.addListener(function (details) {
// Goes through the shared helpers so `runtime.lastError` is always read,
// because an unread one is reported as an extension error.
CompassToolkit.getSettings().then(function (settings) {
return CompassToolkit.saveSettings(settings).then(function () {
console.log("[Compass Toolkit] Settings ready (" + details.reason + ")");
});
});
});