2019-02-05 10:53:26 -05:00
|
|
|
browser.windows.onCreated.addListener(themeWindow);
|
|
|
|
|
|
|
|
// Theme all currently open windows
|
|
|
|
browser.windows.getAll().then(wins => wins.forEach(themeWindow));
|
|
|
|
|
|
|
|
function themeWindow(window) {
|
2019-02-07 17:09:31 -05:00
|
|
|
// 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"
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
2019-02-05 10:53:26 -05:00
|
|
|
}
|