Add skipPermitUnload parameter to ContextualIdentityService.closeContainerTabs
Categories
(Core :: DOM: Security, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox124 | --- | fixed |
People
(Reporter: jdescottes, Assigned: jdescottes)
References
(Blocks 1 open bug)
Details
(Whiteboard: [webdriver:m10][domsecurity-backlog])
Attachments
(1 file)
We should expose an option to skip before unload prompts in ContextualIdentityService.closeContainerTabs and forward it to tabbrowser.removeTab
Assignee | ||
Updated•1 year ago
|
Comment 1•1 year ago
|
||
If this bug is moved to our component, could you explain a bit more what you want to happen?
Updated•1 year ago
|
Assignee | ||
Comment 2•1 year ago
|
||
Sure. In the WebDriver BiDi spec, when removing a user context we should close all related browsing contexts and skip any potential before unload prompt.
To close the tabs we use closeContainerTabs
, which relies on tabbrowser.removeTab
. removeTab
supports a skipPermitUnload
option, so the idea would be to add a skipPermitUnload
parameter to closeContainerTabs
and forward it to removeTab
. So something like:
closeContainerTabs(userContextId = 0, skipPermitUnload=false) {
return new Promise(resolve => {
let remoteTabIds = new Set();
this._forEachContainerTab((tab, tabbrowser) => {
let frameLoader = tab.linkedBrowser.frameLoader;
// We don't have remoteTab in non-e10s mode.
if (frameLoader.remoteTab) {
remoteTabIds.add(frameLoader.remoteTab.tabId);
}
tabbrowser.removeTab(tab, { skipPermitUnload });
}, userContextId);
if (remoteTabIds.size == 0) {
resolve();
return;
}
new _TabRemovalObserver(resolve, remoteTabIds);
});
},
Assignee | ||
Comment 3•1 year ago
|
||
Adds a removeTabOptions optional parameter to closeContainerTabs that will be forwarded to tabbrowser.removeTab
This allows to set options such as skipPermitUnload.
Browser mochitest added to check the new behavior. This should be a noop for current consumers of the API.
Updated•1 year ago
|
Assignee | ||
Updated•1 year ago
|
Description
•