Files
I2P_in_Container_Tabs_for_A…/background.js
2019-02-07 20:14:57 -05:00

43 lines
1.1 KiB
JavaScript

browser.windows.onCreated.addListener(themeWindow);
// Theme all currently open windows
browser.windows.getAll().then(wins => wins.forEach(themeWindow));
function themeWindow(window) {
// Check if the window is in private browsing
if (window.incognito) {
browser.theme.update(window.id, {
images: {
headerURL: "",
},
colors: {
accentcolor: "#A0A0DE",
textcolor: "white",
toolbar: "#A0A0DE",
toolbar_text: "white"
}
});
}
// Reset to the default theme otherwise
else {
browser.theme.update(window.id, {
images: {
headerURL: "",
},
colors: {
accentcolor: "#BFA0DE",
textcolor: "white",
toolbar: "#BFA0DE",
toolbar_text: "white"
}
});
}
}
browser.windows.onCreated.addListener(() => {
const gettingStoredSettings = browser.storage.local.get();
gettingStoredSettings.then(setupProxy, onError);
});