1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-07 02:15:45 +01:00

Fix highlight empty CSS stuff.

This commit is contained in:
Kris Maglione
2008-12-29 13:53:17 -05:00
parent 72cb6c35e9
commit bd2c0f25c6
2 changed files with 9 additions and 6 deletions

View File

@@ -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

View File

@@ -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;
};