Bug 1621450 - Check isTopLevel in RDM onTargetAvailable r=daisuke

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Julian Descottes 2020-03-16 18:21:30 +00:00
Родитель 53b0015f4a
Коммит 3f46acc5a7
1 изменённых файлов: 7 добавлений и 3 удалений

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

@ -391,6 +391,7 @@ class ResponsiveUI {
[this.targetList.TYPES.FRAME],
this.onTargetAvailable
);
this.targetList.stopListening();
}
this.tab.removeEventListener("TabClose", this);
@ -484,6 +485,7 @@ class ResponsiveUI {
const targetFront = await this.client.mainRoot.getTab();
this.targetList = new TargetList(this.client.mainRoot, targetFront);
this.targetList.startListening();
await this.targetList.watchTargets(
[this.targetList.TYPES.FRAME],
this.onTargetAvailable
@ -1177,9 +1179,11 @@ class ResponsiveUI {
return this.browserWindow;
}
async onTargetAvailable({ targetFront }) {
this.responsiveFront = await targetFront.getFront("responsive");
await this.restoreActorState();
async onTargetAvailable({ isTopLevel, targetFront }) {
if (isTopLevel) {
this.responsiveFront = await targetFront.getFront("responsive");
await this.restoreActorState();
}
}
async onRemotenessChange(event) {