SpacesToolbar API incompatibility with tabs API
Categories
(Thunderbird :: Add-Ons: Extensions API, defect)
Tracking
(thunderbird_esr102 wontfix)
Tracking | Status | |
---|---|---|
thunderbird_esr102 | --- | wontfix |
People
(Reporter: schmid-thomas, Assigned: TbSync)
References
Details
Attachments
(1 file, 1 obsolete file)
Create in the background.mjs a new spaces button:
const url = new URL("./libs/managesieve.ui/accounts.html",
window.location);
messenger.spacesToolbar.addButton("sieve_spaces_button", {
"url" : url.toString()
});
Then open a tab via the tabs api:
const url = new URL("./libs/managesieve.ui/accounts.html",
window.location);
await browser.tabs.create({
"active": true,
"url": url.toString()
});
Click anytime later on the new spaces button and the existing the tab
gets a full reload and looses all changes. Despite the URL is exactly
the same. Subsequent clicks on the spaces button won't reload the tab.
Is the new tab is also not marked as a "spaces" tab in spaces toolbar.
Assignee | ||
Comment 1•3 years ago
|
||
This might be a broader issue than it looks at first.
Current behaviour for http(s)://
urls:
tabs.create() will always create a new tab, regardless if a tab with that url exists already or not
Current behaviour for moz-extension://
urls:
tabs.create() will always jump to the existing tab and reload it, if a tab with that url exists already. The code responsible for that is probably in mail/base/content/specialTabs.js
.
The different behaviour of tabs.create()
for moz-extension://
urls and http(s)://
urls feels wrong, specifically the reload. I think we should align the behaviour for http(s)://
urls and moz-extension://
urls.
My suggestions:
- default to "create new tab" for both url types (add-on developers can manually switch to an existing tab using
tabs.update(tabId, {active:true})
) - add a dedicated
openSpacesTab(spaceId)
function to the spacesToolbar API, which will open or jump to the requested spaces tab.
Only the extension which created a space can open it programmatically, as spaceIds are not globally unique but only unique to the extension and extension B has no access to the spaceIds of extension A. This would be fine by me.
Magnus, your thoughts on this?
Assignee | ||
Comment 3•3 years ago
|
||
Updated•3 years ago
|
Assignee | ||
Comment 5•2 years ago
|
||
Comment 6•2 years ago
|
||
Comment on attachment 9270457 [details]
Bug 1762058 - Add function to open space tab. r=aleca
Revision D142703 was moved to bug 1829078. Setting attachment 9270457 [details] to obsolete.
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 7•2 years ago
•
|
||
The missing open() function to be able to open the space tab programmatically will be added in Bug 1829293.
Assignee | ||
Updated•2 years ago
|
Updated•2 years ago
|
Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/8fbe33cf1a17
No longer assimilate existing tabs of foreign spaces, just because they have loaded the same url. r=mkmelin
Assignee | ||
Updated•2 years ago
|
Description
•