Bug 1745158 - Always leave reader mode from the parent actor. r=Gijs

Differential Revision: https://phabricator.services.mozilla.com/D134425
This commit is contained in:
Andreas Farre 2021-12-22 12:15:30 +00:00
parent 3a03dbae83
commit 3b49583af3
2 changed files with 11 additions and 3 deletions

View File

@ -56,8 +56,7 @@ class AboutReaderChild extends JSWindowActorChild {
let article = await this._articlePromise;
this.sendAsyncMessage("Reader:EnterReaderMode", article);
} else {
this._isLeavingReaderableReaderMode = this.isReaderableAboutReader;
this.sendAsyncMessage("Reader:LeaveReaderMode", {});
this.closeReaderMode();
}
break;
@ -236,4 +235,11 @@ class AboutReaderChild extends JSWindowActorChild {
});
}
}
closeReaderMode() {
if (this.isAboutReader) {
this._isLeavingReaderableReaderMode = this.isReaderableAboutReader;
this.sendAsyncMessage("Reader:LeaveReaderMode", {});
}
}
}

View File

@ -482,7 +482,9 @@ AboutReader.prototype = {
},
_onReaderClose() {
ReaderMode.leaveReaderMode(this._actor.docShell, this._win);
if (this._actor) {
this._actor.closeReaderMode();
}
},
async _resetFontSize() {