Closed Bug 1486274 Opened 6 years ago Closed 6 years ago

getAllCookieStores only lists the stores that have open tabs

Categories

(WebExtensions :: General, defect, P3)

61 Branch
defect

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: core, Assigned: mixedpuppy)

References

Details

Attachments

(1 obsolete file)

User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:61.0) Gecko/20100101 Firefox/61.0 Build ID: 20180807170231 Steps to reproduce: - Created a container tab "personal", visited youtube, which sets cookies. - Closed the tab, so that only default store tabs are open - Called browser.cookies.getAllCookieStores() Actual results: - getAllCookieStores() returned only one cookie store, the default one Expected results: - getAllCookieStores() should have returned all cookie stores that exist/contain data.
Priority: -- → P3
This API existed before containers were created, if you're working with containers you might find the contextualIdentities apis more helpful. eg: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/contextualIdentities/query
A (poor) work-around is to open a new tab with a specific cookieStoreId. I also encountered this issue in: https://github.com/Rob--W/cookie-manager/issues/11 Note that in Chrome, if an extension has access to incognito windows, that the incognito cookieStoreId is returned even if there are no incognito windows active.
Status: UNCONFIRMED → NEW
Ever confirmed: true
@aswan: It doesn't even work with the private cookie store id, so this is not container-specific. The contextualIdentities API doesn't report all cookie store ids either.. it only returns the container ids.. My current work-around is to use: "firefox-default" + "firefox-private" + getAllCookieStores() + contextualIdentities.query(), but that is kind of an ugly workaround, since I'm not sure this contains all possible cookie stores at this moment or the possible stores that might appear in the future. This should be fixed. @robwu: Since I want to do automatic cleanup with my extension, that is not really a solution for me. Aside from that, cleaning cookies works even if no tab is open with the specified cookie store.
Assignee: nobody → mixedpuppy
Blocks: 1506653
Priority: P3 → P1
Blocks: 1345474
No longer blocks: 1506653
(In reply to Rob Wu [:robwu] from comment #2) > Note that in Chrome, if an extension has access to incognito windows, that > the incognito cookieStoreId is returned even if there are no incognito > windows active. This statement is incorrect. In Chrome, the incognito cookie store is only included if it exists (i.e. if there is an incognito browser session active).
No longer blocks: 1345474
Priority: P1 → P3
Attachment #9026510 - Attachment is obsolete: true

After thinking about this, I think we're going to wontfix this bug. The current implementation returns cookie stores for any tabs that are open, including container tabs. Given that chrome only includes private store if private tabs are open, I think we should treat the containers the same way.

Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: