Bug 1581925 - Part 2: Use {chrome/content}-document-global-created topic to create SpecialPowers actor, r=kmag

This replaces the old DOMWindowCreated event, and allows SpecialPowers to still
be instantiated for each new chrome document.

Differential Revision: https://phabricator.services.mozilla.com/D47337

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Nika Layzell 2019-10-07 19:35:06 +00:00
Родитель ed104ffa03
Коммит 6ac2292c72
2 изменённых файлов: 7 добавлений и 6 удалений

Просмотреть файл

@ -38,9 +38,10 @@ this.specialpowers = class extends ExtensionAPI {
includeChrome: true,
child: {
moduleURI: "resource://specialpowers/SpecialPowersChild.jsm",
events: {
DOMWindowCreated: {},
},
observers: [
"chrome-document-global-created",
"content-document-global-created",
],
},
parent: {
moduleURI: "resource://specialpowers/SpecialPowersParent.jsm",

Просмотреть файл

@ -187,9 +187,9 @@ class SpecialPowersChild extends JSWindowActorChild {
this._extensionListeners = null;
}
handleEvent(aEvent) {
// We don't actually care much about the "DOMWindowCreated" event.
// We only listen to it to force creation of the actor.
observe(aSubject, aTopic, aData) {
// Ignore the "{chrome/content}-document-global-created" event. It
// is only observed to force creation of the actor.
}
actorCreated() {