Creating named windows to an extension URL opens duplicate tabs
Categories
(WebExtensions :: Compatibility, defect)
Tracking
(Not tracked)
People
(Reporter: pbone, Unassigned, NeedInfo)
References
Details
Attachments
(1 file)
804 bytes,
application/zip
|
Details |
Reported by CoolCmd as part of Bug 1653537, opening named windows to an extension URL will open duplicate windows, rather than refocusing the previously opened window.
Steps to reproduce:
install attached extension.
open https://example.com/
click the page. a new tab should open.
switch to this tab.
Actual results:
2 clicks open 2 tabs.
Expected results:
2 clicks should open 1 tab (like in Chrome 84).
Depends on Bug 1653537 because you'll likely need that fixed to fix this.
Reporter | ||
Comment 1•4 years ago
|
||
The relevant code in the extension is:
document.addEventListener('click', e => {
e.preventDefault();
window.open(chrome.runtime.getURL('coolcmd.html'), 'bug2');
});
Reporter | ||
Comment 2•4 years ago
|
||
See https://html.spec.whatwg.org/multipage/browsers.html#browsing-context-names step 7. The browsing context of the example.com tab might not be "familiar with" the browsing context of the opened, named extension tab. I don't know enough about web stuff to interpret the rules for familiar with, so I don't know if Firefox is correct or not.
Comment 4•4 years ago
|
||
This is very likely caused by bug 1599579, as we currently throw away information like context names when switching browsing context groups. I'm not sure how easily this can be fixed now, as previously the pop-up with the extension URI would be loaded in the same BCG as the opener content script, whereas now it would be opened in a different group, as we can't have it be in the same group as the content page.
ni? for :zombie and :kmag who might have thoughts about what behaviour we want here.
Reporter | ||
Comment 5•4 years ago
|
||
Even when the name is preserved (by the work around in Bug 1653537) it looks like the link between the windows is broken, because a second window is opened, but "window.name" in the console gives the correct name. So I don't know if it's correct to open two or one windows when the linked URL is a web extension.
Reporter | ||
Updated•4 years ago
|
Updated•4 years ago
|
Description
•