Bug 941933: Uplift Add-on SDK to Firefox. r=me

e0ee67e...11344b2
This commit is contained in:
Dave Townsend
2013-11-27 16:43:04 -08:00
parent 47a6ff44a1
commit de3fe79b8a
33 changed files with 743 additions and 175 deletions

View File

@@ -136,18 +136,18 @@ const PageMod = Loader.compose(EventEmitter, {
_applyOnExistingDocuments: function _applyOnExistingDocuments() {
let mod = this;
// Returns true if the tab match one rule
let tabs = getAllTabs().filter(function (tab) {
return mod.include.matchesAny(getTabURI(tab));
});
let tabs = getAllTabs();
tabs.forEach(function (tab) {
// Fake a newly created document
let window = getTabContentWindow(tab);
if (has(mod.attachTo, "top"))
if (has(mod.attachTo, "top") && mod.include.matchesAny(getTabURI(tab)))
mod._onContent(window);
if (has(mod.attachTo, "frame"))
getFrames(window).forEach(mod._onContent);
if (has(mod.attachTo, "frame")) {
getFrames(window).
filter((iframe) => mod.include.matchesAny(iframe.location.href)).
forEach(mod._onContent);
}
});
},