diff options
author | Kris Maglione <maglione.k@gmail.com> | 2011-08-07 17:40:16 -0400 |
---|---|---|
committer | Kris Maglione <maglione.k@gmail.com> | 2011-08-07 17:40:16 -0400 |
commit | 84a69b920a4ce1d10d1d1a4658abec7e3fcbed6f (patch) | |
tree | 4f0692b96616df5f1647ebd4aa02ac566c033626 | |
parent | ac29e49b3dcea6d6d00fc612e51bacc02b0f657d (diff) | |
download | pentadactyl-84a69b920a4ce1d10d1d1a4658abec7e3fcbed6f.tar.gz |
Fix util.generateXPath for unknown namespaces.
-rw-r--r-- | common/content/dactyl.js | 6 | ||||
-rw-r--r-- | common/modules/util.jsm | 4 |
2 files changed, 4 insertions, 6 deletions
diff --git a/common/content/dactyl.js b/common/content/dactyl.js index 1a244ff6..d480b72c 100644 --- a/common/content/dactyl.js +++ b/common/content/dactyl.js @@ -2168,17 +2168,15 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { dactyl.log(_("dactyl.commandlineOpts", util.objectToString(dactyl.commandLineOptions)), 3); - // first time intro message - const firstTime = "extensions." + config.name + ".firsttime"; - if (prefs.get(firstTime, true)) { + if (localPrefs.get("first-run", true)) dactyl.timeout(function () { + localPrefs.set("first-run", false); this.withSavedValues(["forceNewTab"], function () { this.forceNewTab = true; this.help(); prefs.set(firstTime, false); }); }, 1000); - } // TODO: we should have some class where all this guioptions stuff fits well // dactyl.hideGUI(); diff --git a/common/modules/util.jsm b/common/modules/util.jsm index d07980c0..eb32b870 100644 --- a/common/modules/util.jsm +++ b/common/modules/util.jsm @@ -773,7 +773,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]), if (elem.namespaceURI in this.namespaceNames) name = this.namespaceNames[elem.namespaceURI] + ":" + name; else - name = "*:" + name + "[namespace-uri()=" + quote(elem.namespaceURI) + "]"; + name = "*[local-name()=" + quote(name) + " and namespace-uri()=" + quote(elem.namespaceURI) + "]"; res.push(name + "[" + (1 + iter(this.evaluateXPath("./" + name, elem.parentNode)).indexOf(elem)) + "]"); continue; @@ -786,8 +786,8 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]), namespaces: { xul: XUL.uri, - html: XHTML.uri, xhtml: XHTML.uri, + html: XHTML.uri, xhtml2: "http://www.w3.org/2002/06/xhtml2", dactyl: NS.uri }, |