mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-03-27 01:13:34 +01:00
Fix highlight empty CSS stuff.
This commit is contained in:
@@ -1235,8 +1235,6 @@ const liberator = (function () //{{{
|
|||||||
liberator.reportError(e);
|
liberator.reportError(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
liberator.triggerObserver("load");
|
|
||||||
|
|
||||||
// commands must always be the first module to be initialized
|
// commands must always be the first module to be initialized
|
||||||
loadModule("commands", Commands);
|
loadModule("commands", Commands);
|
||||||
loadModule("options", Options);
|
loadModule("options", Options);
|
||||||
@@ -1254,6 +1252,8 @@ const liberator = (function () //{{{
|
|||||||
if (config.init)
|
if (config.init)
|
||||||
config.init();
|
config.init();
|
||||||
|
|
||||||
|
liberator.triggerObserver("load");
|
||||||
|
|
||||||
liberator.log("All modules loaded", 3);
|
liberator.log("All modules loaded", 3);
|
||||||
|
|
||||||
// first time intro message
|
// first time intro message
|
||||||
|
|||||||
@@ -178,11 +178,14 @@ function Highlights(name, store, serial)
|
|||||||
|
|
||||||
let css = newStyle.replace(/(?:!\s*important\s*)?(?:;?\s*$|;)/g, "!important;")
|
let css = newStyle.replace(/(?:!\s*important\s*)?(?:;?\s*$|;)/g, "!important;")
|
||||||
.replace(";!important;", ";", "g"); // Seeming Spidermonkey bug
|
.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);
|
let error = styles.addSheet(true, style.selector, style.filter, css);
|
||||||
if (error)
|
if (error)
|
||||||
return error;
|
return error;
|
||||||
|
}
|
||||||
style.value = newStyle;
|
style.value = newStyle;
|
||||||
highlight[style.class] = style;
|
highlight[style.class] = style;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user