Skip to content

Commit e3b12b0

Browse files
authored
browser(firefox): fix closing browser contexts with beforeunload (#4314)
References #4021
1 parent 3d3ce13 commit e3b12b0

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

browser_patches/firefox/BUILD_NUMBER

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
1199
2-
Changed: [email protected] Mon 02 Nov 2020 04:10:47 PM PST
1+
1200
2+
Changed: [email protected] Mon 02 Nov 2020 05:18:01 PM PST

browser_patches/firefox/juggler/TargetRegistry.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -417,8 +417,8 @@ class PageTarget {
417417
await this.updateViewportSize();
418418
}
419419

420-
async close(runBeforeUnload = false) {
421-
await this._gBrowser.removeTab(this._tab, {
420+
close(runBeforeUnload = false) {
421+
this._gBrowser.removeTab(this._tab, {
422422
skipPermitUnload: !runBeforeUnload,
423423
});
424424
}
@@ -562,7 +562,8 @@ class BrowserContext {
562562
async destroy() {
563563
if (this.userContextId !== 0) {
564564
ContextualIdentityService.remove(this.userContextId);
565-
ContextualIdentityService.closeContainerTabs(this.userContextId);
565+
for (const page of this.pages)
566+
page.close();
566567
if (this.pages.size) {
567568
await new Promise(f => {
568569
const listener = helper.on(this._registry, TargetRegistry.Events.TargetDestroyed, () => {

0 commit comments

Comments
 (0)