Calling window.close() from an "WebExtension"-registered devtools panel shouldn't close the browser chrome window
Categories
(WebExtensions :: Developer Tools, defect, P3)
Tracking
(firefox134 fixed)
Tracking | Status | |
---|---|---|
firefox134 | --- | fixed |
People
(Reporter: rpl, Assigned: rking)
References
Details
Attachments
(2 files)
While testing out a corner case related to WebExtensions-registered devtools panel as part of reviewing the patch attached to Bug 1921631, Becca and I have noticed that when window.close was being called from a WebExtensions-registered devtools panel while there is only one tab open in a Firefox browser window, that window was closed as a side-effect of that (and the entire browser shutdown if that was the only Firefox window open).
The issue can be hit with the test extension I'm attaching to this bug (and without any of the changes from the patch attached to Bug 1921631) using the following STR:
- Open a Firefox instance with only one Firefox window and one tab open
- load about:debugging in the only tab, and install temporarily the test extension attached to this bug
- While only one Firefox tab is open, open the devtools toolbox in that tab, select the custom devtools panel registered by the extension
- Click on the button inside the WebExtension-registered devtools panel
- Actual Behavior: Firefox window (and tab) is closed
- Expected Behavior: the Firefox window (and tab) to stay open
The issue seems to be due to the DOMWindowClose event bubbling up from the browser
element nested inside the devtools toolbox where the extension page providing the custom devtools panel is being loaded, up to being then handled by the DOMWindowClose event listener registered from inside the gBrowser's _setupEventListeners method here:
Reporter | ||
Updated•3 months ago
|
Description
•