diff --git a/common/content/browser.js b/common/content/browser.js index cee3adbc..cc504ff1 100644 --- a/common/content/browser.js +++ b/common/content/browser.js @@ -180,7 +180,7 @@ var Browser = Module("browser", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), setOverLink: util.wrapCallback(function setOverLink(link, b) { setOverLink.superapply(this, arguments); dactyl.triggerObserver("browser.overLink", link); - }), + }) } }, { }, { @@ -204,6 +204,7 @@ var Browser = Module("browser", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), function () { window.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils) .redraw(); + statusline.overLink = null; statusline.updateStatus(); commandline.clear(); }, diff --git a/common/content/dactyl.js b/common/content/dactyl.js index dc9df88b..1fa8f216 100644 --- a/common/content/dactyl.js +++ b/common/content/dactyl.js @@ -1939,7 +1939,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { if (dactyl.commandLineOptions.rcFile == "NONE" || dactyl.commandLineOptions.noPlugins) options["loadplugins"] = []; - if (options["loadplugins"]) + if (options["loadplugins"].length) dactyl.loadPlugins(); } catch (e) { diff --git a/common/content/statusline.js b/common/content/statusline.js index 8eefc33e..5b7d2a88 100644 --- a/common/content/statusline.js +++ b/common/content/statusline.js @@ -110,9 +110,11 @@ var StatusLine = Module("statusline", { "browser.overLink": function (link) { switch (options["showstatuslinks"]) { case "status": + this.overLink = link ? _("status.link", link) : null; this.status = link ? _("status.link", link) : buffer.uri; break; case "command": + this.overLink = null; if (link) dactyl.echo(_("status.link", link), commandline.FORCE_SINGLELINE); else @@ -250,7 +252,7 @@ var StatusLine = Module("statusline", { updateStatus: function updateStatus() { this.timeout(function () { - this.status = buffer.uri; + this.status = this.overLink || buffer.uri; }); }, diff --git a/common/modules/dom.jsm b/common/modules/dom.jsm index 981ec9c8..af623f04 100644 --- a/common/modules/dom.jsm +++ b/common/modules/dom.jsm @@ -191,11 +191,11 @@ var DOM = Class("DOM", { this.each(function (elem) { while(true) { elem = fn.call(this, elem) - if (elem instanceof Ci.nsIDOMElement) + if (elem instanceof Ci.nsIDOMNode) res[res.length++] = elem; else if (elem && "length" in elem) - for (let i = 0; i < tmp.length; i++) - res[res.length++] = tmp[j]; + for (let i = 0; i < elem.length; i++) + res[res.length++] = elem[j]; else break; } @@ -256,6 +256,9 @@ var DOM = Class("DOM", { get siblingsBefore() this.all(function (elem) elem.previousElementSibling), get siblingsAfter() this.all(function (elem) elem.nextElementSibling), + get allSiblingsBefore() this.all(function (elem) elem.previousSibling), + get allSiblingsAfter() this.all(function (elem) elem.nextSibling), + get class() let (self = this) ({ toString: function () self[0].className, diff --git a/common/modules/help.jsm b/common/modules/help.jsm index d12312bd..475b0dd4 100644 --- a/common/modules/help.jsm +++ b/common/modules/help.jsm @@ -317,12 +317,12 @@ var Help = Module("Help", { .split(" ")); function fix(node) { switch(node.nodeType) { - case Node.ELEMENT_NODE: - if (isinstance(node, [HTMLBaseElement])) + case Ci.nsIDOMNode.ELEMENT_NODE: + if (isinstance(node, [Ci.nsIDOMHTMLBaseElement])) return; data.push("<"); data.push(node.localName); - if (node instanceof HTMLHtmlElement) + if (node instanceof Ci.nsIDOMHTMLHtmlElement) data.push(" xmlns=" + XHTML.uri.quote(), " xmlns:dactyl=" + NS.uri.quote()); @@ -335,8 +335,14 @@ var Help = Module("Help", { if (name == "href") { value = node.href || value; if (value.indexOf("dactyl://help-tag/") == 0) { - let uri = services.io.newChannel(value, null, null).originalURI; - value = uri.spec == value ? "javascript:;" : uri.path.substr(1); + try { + let uri = services.io.newChannel(value, null, null).originalURI; + value = uri.spec == value ? "javascript:;" : uri.path.substr(1); + } + catch (e) { + util.dump("Magical tag thingy failure for: " + value); + dactyl.reportError(e); + } } if (!/^#|[\/](#|$)|^[a-z]+:/.test(value)) value = value.replace(/(#|$)/, ".xhtml$1"); @@ -354,24 +360,26 @@ var Help = Module("Help", { data.push(" />"); else { data.push(">"); - if (node instanceof HTMLHeadElement) + if (node instanceof Ci.nsIDOMHTMLHeadElement) data.push(.toXMLString()); Array.map(node.childNodes, fix); data.push(""); } break; - case Node.TEXT_NODE: + case Ci.nsIDOMNode.TEXT_NODE: data.push(<>{node.textContent}.toXMLString()); } } + let { buffer, content, events } = modules; let chromeFiles = {}; let styles = {}; + for (let [file, ] in Iterator(help.files)) { let url = "dactyl://help/" + file; dactyl.open(url); util.waitFor(function () content.location.href == url && buffer.loaded - && content.document.documentElement instanceof HTMLHtmlElement, + && content.document.documentElement instanceof Ci.nsIDOMHTMLHtmlElement, 15000); events.waitForPageLoad(); var data = [