mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-24 03:12:27 +01:00
Fix util.generateXPath for unknown namespaces.
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user