1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-28 16:35:46 +01:00

Make :sty* commands more site-aware, more sensibly sorted.

This commit is contained in:
Kris Maglione
2010-12-17 07:46:46 -05:00
parent 449bcfa8a2
commit a632172c0f
3 changed files with 137 additions and 50 deletions

View File

@@ -1162,6 +1162,30 @@ const Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference])
}
},
visibleHosts: function (win) {
let res = [], seen = {};
(function rec(frame) {
try {
res = res.concat(util.subdomains(frame.location.host));
}
catch (e) {}
Array.forEach(frame.frames, rec);
})(win);
return res.filter(function (h) !set.add(seen, h));
},
visibleURIs: function (win) {
let res = [], seen = {};
(function rec(frame) {
try {
res = res.concat(util.newURI(frame.location.href));
}
catch (e) {}
Array.forEach(frame.frames, rec);
})(win);
return res.filter(function (h) !set.add(seen, h.spec));
},
/**
* Converts an E4X XML literal to a DOM node. Any attribute named
* highlight is present, it is transformed into dactyl:highlight,