multi-account-containers
multi-account-containers copied to clipboard
Container tabs have inconsistent IDs
Before submitting a bug report
- [X] I updated to the latest version of Multi-Account Container and tested if I can reproduce the issue
- [X] I searched for existing reports to see if it hasn't already been reported
Step to reproduce
- Open a bookmark that is set to launch in a container in a new tab and log its ID!
browser.tabs.create({url: bookmark.url, windowId: 1, active: false})
.then((tab) => {
console.debug(tab.id);
}, (error) => {
console.error(`Could not create tab: ${error}`);
});
- Log the ID of the new tab after webNavigation has completed!
browser.webNavigation.onCompleted.addListener((details) => console.debug(details.tabId));
Actual behavior
The ID of the created tab in step 1 is different than the ID of the same tab in step 2. The tab changes its identity.
Expected behavior
The ID of a tab should be immutable/consistent. Changes should be at least observable. Extensions that create tabs should be able to close them again.
This is the expected behavior because you create the tab in the default contextualidentity since you didn't specify the cookieStoreId parameter (see: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs/create). So what's currently happening is:
- Create tab in default context
- Multi-Account Container rules kick in and move the tab to a new context (it needs to close and reopen a new tab for that. This is how it's implemented in Firefox itself and we can't control that on the addon side).
onCompletedlistener returns the id of the container tab which is different from the first tab created
Related to: https://github.com/mozilla/multi-account-containers/issues/1029