diff --git a/common/content/bookmarks.js b/common/content/bookmarks.js index 095ef8d3..65a6846c 100644 --- a/common/content/bookmarks.js +++ b/common/content/bookmarks.js @@ -399,7 +399,6 @@ const Bookmarks = Module("bookmarks", { { bang: true, completer: function completer(context, args) { - context.quote = null; context.filter = args.join(" "); completion.bookmark(context, args["-tags"], { keyword: args["-keyword"], title: args["-title"] }); }, diff --git a/common/content/commands.js b/common/content/commands.js index cc1e060a..9c41742c 100644 --- a/common/content/commands.js +++ b/common/content/commands.js @@ -408,11 +408,11 @@ const ex = { dactyl.assert(cmd, "No such command"); return update(function exCommand(options) { - let args = this._args(cmd, arguments); + let args = ex._args(cmd, arguments); args.verify(); return cmd.execute(args); }, { - dactylCompleter: this._complete(cmd) + dactylCompleter: ex._complete(cmd) }); }, diff --git a/common/content/completion.js b/common/content/completion.js index c69e3344..a8486908 100644 --- a/common/content/completion.js +++ b/common/content/completion.js @@ -538,7 +538,7 @@ const CompletionContext = Class("CompletionContext", { */ advance: function advance(count) { delete this._ignoreCase; - if (this.quote) { + if (this.quote && count) { count = this.quote[0].length + this.quote[1](this.filter.substr(0, count)).length; this.quote[0] = ""; this.quote[2] = ""; @@ -608,13 +608,6 @@ const CompletionContext = Class("CompletionContext", { return context; }, - getText: function getText(item) { - let text = item[self.keys["text"]]; - if (self.quote) - return self.quote(text); - return text; - }, - highlight: function highlight(start, length, type) { if (arguments.length == 0) { for (let type in this.selectionTypes) diff --git a/common/content/dactyl.js b/common/content/dactyl.js index 292df0ea..98d0d6e2 100644 --- a/common/content/dactyl.js +++ b/common/content/dactyl.js @@ -297,7 +297,7 @@ const Dactyl = Module("dactyl", { if (!context) context = userContext; - if (!window.XPCSafeJSObjectWrapper) + if (window.isPrototypeOf(modules)) return Cu.evalInSandbox(str, context, "1.8", fileName, lineNumber); return Cu.evalInSandbox("with (window) { with (modules) { this.eval(" + str.quote() + ") } }", context, "1.8", fileName, lineNumber); }, @@ -2016,8 +2016,8 @@ const Dactyl = Module("dactyl", { let init = services.get("environment").get(config.idName + "_INIT"); let rcFile = io.getRCFile("~"); - if (!window.XPCSafeJSObjectWrapper) - jsmodules.__proto__ = XPCNativeWrapper(window); + if (dactyl.userEval('typeof document') === "undefined") + jsmodules.__proto__ = (window.XPCSafeJSObjectWrapper || XPCNativeWrapper)(window); try { if (dactyl.commandLineOptions.rcFile) { diff --git a/common/content/options.js b/common/content/options.js index 7b1e5b31..c7890cb3 100644 --- a/common/content/options.js +++ b/common/content/options.js @@ -224,7 +224,6 @@ const Option = Class("Option", { op: function (operator, values, scope, invert, str) { let newValues = this._op(operator, values, scope, invert); - if (newValues == null) return "Operator " + operator + " not supported for option type " + this.type; @@ -538,6 +537,7 @@ const Option = Class("Option", { stringlist: function (operator, values, scope, invert) { values = Array.concat(values); + switch (operator) { case "+": return array.uniq(Array.concat(this.value, values), true); diff --git a/common/modules/base.jsm b/common/modules/base.jsm index c9b0bdf1..51b0ae35 100644 --- a/common/modules/base.jsm +++ b/common/modules/base.jsm @@ -1132,7 +1132,7 @@ const array = Class("array", Array, { uniq: function uniq(ary, unsorted) { let ret = []; if (unsorted) { - for (let [, item] in Iterator(ary)) + for (let item in values(ary)) if (ret.indexOf(item) == -1) ret.push(item); }