1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-16 07:55:45 +01:00

Use a better document iterator for applying overlays so that we can overlay documents in tabs as well.

This commit is contained in:
Kris Maglione
2011-02-02 16:21:57 -05:00
parent 475a3244c5
commit 475da7edd9
2 changed files with 28 additions and 9 deletions

View File

@@ -52,13 +52,15 @@ function checkDocument(doc, disable, force) {
}
function chromeDocuments() {
let windows = Services.ww.getXULWindowEnumerator(null);
let windows = services.windowMediator.getXULWindowEnumerator(null);
while (windows.hasMoreElements()) {
let window = windows.getNext().QueryInterface(Ci.nsIXULWindow);
let docShells = window.docShell.getDocShellEnumerator(Ci.nsIDocShell.typeChrome,
Ci.nsIDocShell.ENUMERATE_FORWARDS);
while (docShells.hasMoreElements())
yield docShells.getNext().containedDocShells.DOMDocument;
for each (let type in ["typeChrome", "typeContent"]) {
let docShells = window.docShell.getDocShellEnumerator(Ci.nsIDocShellTreeItem[type],
Ci.nsIDocShell.ENUMERATE_FORWARDS);
while (docShells.hasMoreElements())
yield docShells.getNext().QueryInterface(Ci.nsIDocShell).contentViewer.DOMDocument;
}
}
}