Bug 1322856 - Expose ContextualIdentities (aka containers) to WebExtensions - part 1, r=kmaglione
This commit is contained in:
@@ -22,7 +22,7 @@ global.getCookieStoreIdForTab = function(data, tab) {
|
||||
}
|
||||
|
||||
if (tab.userContextId) {
|
||||
return CONTAINER_STORE + tab.userContextId;
|
||||
return getCookieStoreIdForContainer(tab.userContextId);
|
||||
}
|
||||
|
||||
return DEFAULT_STORE;
|
||||
@@ -40,6 +40,10 @@ global.isContainerCookieStoreId = function(storeId) {
|
||||
return storeId !== null && storeId.startsWith(CONTAINER_STORE);
|
||||
};
|
||||
|
||||
global.getCookieStoreIdForContainer = function(containerId) {
|
||||
return CONTAINER_STORE + containerId;
|
||||
};
|
||||
|
||||
global.getContainerForCookieStoreId = function(storeId) {
|
||||
if (!global.isContainerCookieStoreId(storeId)) {
|
||||
return null;
|
||||
@@ -76,7 +80,7 @@ function convert({cookie, isPrivate}) {
|
||||
}
|
||||
|
||||
if (cookie.originAttributes.userContextId) {
|
||||
result.storeId = CONTAINER_STORE + cookie.originAttributes.userContextId;
|
||||
result.storeId = getCookieStoreIdForContainer(cookie.originAttributes.userContextId);
|
||||
} else if (cookie.originAttributes.privateBrowsingId || isPrivate) {
|
||||
result.storeId = PRIVATE_STORE;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user