diff --git a/content/completion.js b/content/completion.js index 04a6f2ed..85ddc8b9 100644 --- a/content/completion.js +++ b/content/completion.js @@ -864,7 +864,7 @@ liberator.Completion = function () //{{{ { if (h[0].indexOf(begin) == 0 && (!end.length || h[0].substr(-end.length) == end)) { - let query = h[0].substr(begin.length, h[0].length - end.length); + let query = h[0].substring(begin.length, h[0].length - end.length); searches.push([decodeURIComponent(query), <>{begin}{query}{end}, k[2]]); diff --git a/content/liberator.js b/content/liberator.js index 8d5b8e89..03a30edc 100644 --- a/content/liberator.js +++ b/content/liberator.js @@ -603,18 +603,17 @@ const liberator = (function () //{{{ if (liberator.options["visualbell"]) { // flash the visual bell - var popup = document.getElementById("liberator-visualbell"); - var win = liberator.config.visualbellWindow; - var box = document.getBoxObjectFor(win); + let popup = document.getElementById("liberator-visualbell"); + let win = liberator.config.visualbellWindow; + let box = document.getBoxObjectFor(win); - popup.height = box.height; - popup.width = box.width; popup.openPopup(win, "overlap", 0, 0, false, false); - setTimeout(function () { popup.hidePopup(); }, 50); + popup.sizeTo(box.width - 2, box.height - 2); + setTimeout(function () { popup.hidePopup(); }, 20); } else { - var soundService = Components.classes["@mozilla.org/sound;1"] + let soundService = Components.classes["@mozilla.org/sound;1"] .getService(Components.interfaces.nsISound); soundService.beep(); } @@ -1131,8 +1130,8 @@ const liberator = (function () //{{{ // set before by any rc file for (let option in liberator.options) { - if (option.setter && !option.hasChanged) - option.reset(); + if (option.setter) + option.value = option.value; } liberator.triggerObserver("enter", null); diff --git a/content/liberator.xul b/content/liberator.xul index e5bb92d5..ca3a6bd1 100644 --- a/content/liberator.xul +++ b/content/liberator.xul @@ -62,7 +62,9 @@ the terms of any one of the MPL, the GPL or the LGPL. - + + + diff --git a/content/options.js b/content/options.js index 9d48e4ae..0835adcf 100644 --- a/content/options.js +++ b/content/options.js @@ -118,7 +118,7 @@ liberator.Option = function (names, description, type, defaultValue, extraInfo) if (liberator.has("tabs") && (scope & liberator.options.OPTION_SCOPE_LOCAL)) liberator.tabs.options[this.name] = newValue; - if (scope & liberator.options.OPTION_SCOPE_GLOBAL && newValue != this.globalValue) + if ((scope & liberator.options.OPTION_SCOPE_GLOBAL) && newValue != this.globalValue) this.globalvalue = newValue; this.hasChanged = true; @@ -437,7 +437,6 @@ liberator.Options = function () //{{{ if (!matches) return null; - ret.scope = modifiers && modifiers.scope; ret.option = liberator.options.get(ret.name, ret.scope); @@ -524,6 +523,9 @@ liberator.Options = function () //{{{ } let opt = parseOpt(args, modifiers); + if (!opt) + return; + let option = opt.option; // reset a variable to its default value