diff --git a/common/content/liberator.js b/common/content/liberator.js index 62f150f9..375b02fe 100644 --- a/common/content/liberator.js +++ b/common/content/liberator.js @@ -1235,8 +1235,6 @@ const liberator = (function () //{{{ liberator.reportError(e); } - liberator.triggerObserver("load"); - // commands must always be the first module to be initialized loadModule("commands", Commands); loadModule("options", Options); @@ -1254,6 +1252,8 @@ const liberator = (function () //{{{ if (config.init) config.init(); + liberator.triggerObserver("load"); + liberator.log("All modules loaded", 3); // first time intro message diff --git a/common/content/style.js b/common/content/style.js index 6388aadd..b399849a 100644 --- a/common/content/style.js +++ b/common/content/style.js @@ -178,11 +178,14 @@ function Highlights(name, store, serial) let css = newStyle.replace(/(?:!\s*important\s*)?(?:;?\s*$|;)/g, "!important;") .replace(";!important;", ";", "g"); // Seeming Spidermonkey bug - css = style.selector + " { " + css + " }"; + if (!/^\s*(?:!\s*important\s*)?;*\s*$/.test(css)) + { + css = style.selector + " { " + css + " }"; - let error = styles.addSheet(true, style.selector, style.filter, css); - if (error) - return error; + let error = styles.addSheet(true, style.selector, style.filter, css); + if (error) + return error; + } style.value = newStyle; highlight[style.class] = style; };