mirror of
https://github.com/zen-browser/desktop.git
synced 2025-09-05 19:08:18 +00:00
Enhance tab closing behavior with permitUnload check and update test for consistency
This commit is contained in:
@@ -211,6 +211,11 @@
|
||||
return;
|
||||
}
|
||||
|
||||
let { permitUnload } = this.#currentBrowser.permitUnload();
|
||||
if (!permitUnload) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (onTabClose && hasFocused && !this.#confirmationTimeout) {
|
||||
const cancelButton = document.getElementById('zen-glance-sidebar-close');
|
||||
cancelButton.setAttribute('waitconfirmation', true);
|
||||
@@ -300,7 +305,6 @@
|
||||
}
|
||||
|
||||
// reset everything
|
||||
const prevOverlay = this.overlay;
|
||||
this.browserWrapper = null;
|
||||
this.overlay = null;
|
||||
this.contentWrapper = null;
|
||||
@@ -312,7 +316,7 @@
|
||||
gBrowser.selectedTab = this.#currentParentTab;
|
||||
}
|
||||
this._ignoreClose = true;
|
||||
gBrowser.removeTab(this.lastCurrentTab, { animate: true });
|
||||
gBrowser.removeTab(this.lastCurrentTab, { animate: true, skipPermitUnload: true });
|
||||
gBrowser.tabContainer._invalidateCachedTabs();
|
||||
|
||||
this.#currentParentTab.removeAttribute('glance-id');
|
||||
|
@@ -1,8 +1,8 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
https://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
"use strict";
|
||||
'use strict';
|
||||
|
||||
add_task(async function test_TODO() {
|
||||
ok(true, "TODO: implement the test");
|
||||
ok(true, 'TODO: implement the test');
|
||||
});
|
||||
|
Reference in New Issue
Block a user