This is concerning reading cookies with GeckoView on Android.
Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1035417, we can only do so via web extensions.
In GeckoView, we can supply contextId
when creating tabs. Doing so provides the id for the session's cookie store, and I can verify the behaviour by:
- Changing the id and seeing that GeckoView uses a different cookie store
- Calling
browser.cookies.getAllCookieStore
in a background script and seeing the list of containers.
However, when calling browser.cookies.getAll({})
, I see that all the cookies are there, and that they all have storeId
set to firefox-default
. If I create two tabs with different contextId
s and log into the same site, I see cookies from both logins under firefox-default
. Is this a limitation of the current GeckoView implementation, or is there anything in particular I need to do to distinguish between the cookie stores?
- I'm using manifest 2; I've noticed that with manifest 3, I couldn't read cookies at all.
- I'm calling
browser.cookies
in a background script in a built in extension, within a callback (currentlybrowser.tabs.onActivated
) - My manifest permissions:
"<all_urls>",
"activeTab",
"contextMenus",
"contextualIdentities",
"cookies",
"history",
"management",
"tabs",
"nativeMessaging",
"nativeMessagingFromContent",
"geckoViewAddons",
"webRequest"
They aren't all needed by I'm modelling it off of Firefox's multi container extension
I do also notice that that extension isn't available in Android.