diff --git a/content/buffer.js b/content/buffer.js index d823cc56..cd1c2bef 100644 --- a/content/buffer.js +++ b/content/buffer.js @@ -1111,7 +1111,8 @@ liberator.Buffer = function () //{{{ let cssClass = class[1] || ".hl-" + class[0]; let scope = class[2] || highlightDocs; - let getCSS = function (style) cssClass + selectors + " { " + style.replace(/(?:!\s*important\s*)?(?:;?$|;)/g, "!important;") + " }"; + let getCSS = function (style) cssClass + selectors + + " { " + style.replace(/(?:!\s*important\s*)?(?:;?\s*$|;)/g, "!important;").replace(";!important;", ";", "g") + " }"; let css = getCSS(style); if (highlight.get(key)) diff --git a/content/completion.js b/content/completion.js index b31c763d..c9429cae 100644 --- a/content/completion.js +++ b/content/completion.js @@ -318,7 +318,7 @@ liberator.Completion = function () //{{{ } catch (e) { - liberator.dump(liberator.util.escapeString(string) + ": " + e + "\n" + e.stack + "\n"); + liberator.dump(liberator.util.escapeString(string) + ": " + e + "\n" + e.stack); lastIdx = 0; return [0, []]; } diff --git a/content/events.js b/content/events.js index 6242be7d..e3bf5499 100644 --- a/content/events.js +++ b/content/events.js @@ -536,7 +536,7 @@ liberator.Events = function () //{{{ // return true when load successful, or false otherwise function waitForPageLoaded() { - liberator.dump("start waiting in loaded state: " + liberator.buffer.loaded + "\n"); + liberator.dump("start waiting in loaded state: " + liberator.buffer.loaded); liberator.threadyield(true); // clear queue if (liberator.buffer.loaded == 1) @@ -548,7 +548,7 @@ liberator.Events = function () //{{{ { liberator.threadyield(); if ((now - then) % 1000 < 10) - liberator.dump("waited: " + (now - then) + " ms\n"); + liberator.dump("waited: " + (now - then) + " ms"); if (!liberator.modes.isReplaying) return false; @@ -567,7 +567,7 @@ liberator.Events = function () //{{{ var ret = (liberator.buffer.loaded == 1); if (!ret) liberator.echoerr("Page did not load completely in " + ms + " milliseconds. Macro stopped."); - liberator.dump("done waiting: " + ret + "\n"); + liberator.dump("done waiting: " + ret); // sometimes the input widget had focus when replaying a macro // maybe this call should be moved somewhere else? @@ -715,7 +715,7 @@ liberator.Events = function () //{{{ destroy: function () { // removeEventListeners() to avoid mem leaks - liberator.dump("TODO: remove all eventlisteners\n"); + liberator.dump("TODO: remove all eventlisteners"); if (typeof getBrowser != "undefined") getBrowser().removeProgressListener(this.progressListener); @@ -1049,7 +1049,7 @@ liberator.Events = function () //{{{ { if (liberator.config.isComposeWindow) { - liberator.dump("Compose editor got focus\n"); + liberator.dump("Compose editor got focus"); liberator.modes.set(liberator.modes.INSERT, liberator.modes.TEXTAREA); } else if (liberator.mode != liberator.modes.MESSAGE) diff --git a/content/liberator.js b/content/liberator.js index b84212cf..8eac9852 100644 --- a/content/liberator.js +++ b/content/liberator.js @@ -44,7 +44,7 @@ const liberator = (function () //{{{ try { liberator.log(message, 0); - liberator.dump(message + "\n"); + liberator.dump(message); liberator[name] = func(); } catch (e) @@ -52,8 +52,7 @@ const liberator = (function () //{{{ toJavaScriptConsole(); if (Components.utils.reportError) Components.utils.reportError(e); - liberator.dump(e + "\n"); - liberator.dump(e.stack + "\n"); + liberator.dump(e); } } @@ -661,14 +660,7 @@ const liberator = (function () //{{{ dumpStack: function (msg) { - try - { - someStatisticallyImprobableVariableName.foo = 1; - } - catch (e) - { - liberator.dump((msg || "") + e.stack); - } + liberator.dump((msg || "") + (new Error()).stack.replace(/.*\n/, "")); }, // with (liberator) means, liberator is the default namespace "inside" eval