Changeset View
Changeset View
Standalone View
Standalone View
extension/extension.js
Show All 35 Lines | 18 | function sendEnvironment() { | |||
---|---|---|---|---|---|
36 | } else if(ua.match(/firefox/i)) { | 36 | } else if(ua.match(/firefox/i)) { | ||
37 | browser = "firefox"; | 37 | browser = "firefox"; | ||
38 | } | 38 | } | ||
39 | 39 | | |||
40 | sendPortMessage("settings", "setEnvironment", {browserName: browser}); | 40 | sendPortMessage("settings", "setEnvironment", {browserName: browser}); | ||
41 | } | 41 | } | ||
42 | 42 | | |||
43 | function sendSettings() { | 43 | function sendSettings() { | ||
44 | storage.get(DEFAULT_EXTENSION_SETTINGS, function (items) { | 44 | SettingsUtils.get().then((items) => { | ||
45 | if (chrome.runtime.lastError) { | | |||
46 | console.warn("Failed to load settings"); | | |||
47 | return; | | |||
48 | } | | |||
49 | | ||||
50 | sendPortMessage("settings", "changed", items); | 45 | sendPortMessage("settings", "changed", items); | ||
51 | }); | 46 | }); | ||
52 | } | 47 | } | ||
53 | 48 | | |||
54 | // activates giveb tab and raises its window, used by tabs runner and mpris Raise command | 49 | // activates giveb tab and raises its window, used by tabs runner and mpris Raise command | ||
55 | function raiseTab(tabId) { | 50 | function raiseTab(tabId) { | ||
56 | // first activate the tab, this means it's current in its window | 51 | // first activate the tab, this means it's current in its window | ||
57 | chrome.tabs.update(tabId, {active: true}, function (tab) { | 52 | chrome.tabs.update(tabId, {active: true}, function (tab) { | ||
▲ Show 20 Lines • Show All 197 Lines • Show Last 20 Lines |