1
0
Fork 0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2025-07-04 20:46:39 +02:00

Added centralized theme system and themed all pages

This commit is contained in:
kkapsner 2019-05-02 00:30:30 +02:00
parent c2a817478e
commit 6301b744d2
39 changed files with 448 additions and 127 deletions

View file

@ -15,6 +15,7 @@
const settingStrings = require("../lib/settingStrings");
const searchParameters = new URLSearchParams(window.location.search);
const settingsMigration = require("../lib/settingsMigration");
require("./theme").init("options");
var callbacks = {
openNavigatorSettings: function(){
@ -428,16 +429,6 @@
document.body.appendChild(version);
settings.onloaded(function(){
// load theme
var themeLink = document.createElement("link");
themeLink.href = `options-${settings.theme}.css`;
themeLink.rel = "stylesheet";
themeLink.type = "text/css";
document.head.appendChild(themeLink);
settings.on("theme", function(){
themeLink.href = `options-${settings.theme}.css`;
});
const reCaptchaEntry = "^https://www\\.google\\.com/recaptcha/api2/(?:b?frame|anchor).*$";
const {url: urlContainer} = settings.getContainers();
settings.on("protectWindow", function({newValue}){