diff --git a/common/content/commandline.js b/common/content/commandline.js index 6ef6f71c..02187d14 100644 --- a/common/content/commandline.js +++ b/common/content/commandline.js @@ -21,6 +21,9 @@ var CommandWidgets = Class("CommandWidgets", { + @@ -937,14 +940,21 @@ var CommandLine = Module("commandline", { }, onContext: function onContext(event) { - let enabled = { - link: window.document.popupNode instanceof HTMLAnchorElement, - selection: !window.document.commandDispatcher.focusedWindow.getSelection().isCollapsed - }; + try { + let enabled = { + link: window.document.popupNode instanceof HTMLAnchorElement, + path: window.document.popupNode.hasAttribute("path"), + selection: !window.document.commandDispatcher.focusedWindow.getSelection().isCollapsed + }; - for (let [, node] in iter(event.target.childNodes)) { - let group = node.getAttributeNS(NS, "group"); - node.hidden = group && !group.split(/\s+/).some(function (g) enabled[g]); + for (let node in array.iterValues(event.target.children)) { + let group = node.getAttributeNS(NS, "group"); + util.dump(node, group, group && !group.split(/\s+/).every(function (g) enabled[g])); + node.hidden = group && !group.split(/\s+/).every(function (g) enabled[g]); + } + } + catch (e) { + util.reportError(e); } return true; }, @@ -1100,6 +1110,9 @@ var CommandLine = Module("commandline", { event.originalTarget.hasAttributeNS(NS, "command"))) { let command = event.originalTarget.getAttributeNS(NS, "command"); + if (command && event.button == 2) + return PASS; + if (command && dactyl.commands[command]) { event.preventDefault(); return dactyl.withSavedValues(["forceNewTab"], function () { diff --git a/common/content/dactyl.js b/common/content/dactyl.js index 5e706e7e..e454e1b0 100644 --- a/common/content/dactyl.js +++ b/common/content/dactyl.js @@ -363,7 +363,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { userEval: function (str, context, fileName, lineNumber) { if (jsmodules.__proto__ != window) - str = "with (window) { with (modules) { this.eval(" + str.quote() + ") } }"; + str = "with (window) { with (modules) { (this.eval || eval)(" + str.quote() + ") } }"; if (fileName == null) if (io.sourcing && io.sourcing.file[0] !== "[") diff --git a/common/modules/bootstrap.jsm b/common/modules/bootstrap.jsm index 4149828a..658fbafa 100644 --- a/common/modules/bootstrap.jsm +++ b/common/modules/bootstrap.jsm @@ -4,8 +4,6 @@ // given in the LICENSE.txt file included with this file. "use strict"; -dump(" ======================= bootstrap.jsm " + (typeof JSMLoader) + " ======================= \n"); - var EXPORTED_SYMBOLS = ["JSMLoader"]; let global = this; diff --git a/common/modules/downloads.jsm b/common/modules/downloads.jsm index 1e24d1cc..73d69f26 100644 --- a/common/modules/downloads.jsm +++ b/common/modules/downloads.jsm @@ -29,7 +29,7 @@ var Download = Class("Download", {