Use the browser.contextualIdentities API to query and modify contextual identity, also called as containers.

Permissions: contextualIdentities

Not allowed in: Content scripts, Devtools pages

_CreateDetails
_OnCreatedChangeInfo
_OnRemovedChangeInfo
_OnUpdatedChangeInfo
_QueryDetails
_UpdateDetails
ContextualIdentity
onCreated
onRemoved
onUpdated
create
get
query
remove
update
onCreated: WebExtEvent<(changeInfo: _OnCreatedChangeInfo) => void>

Fired when a new container is created.

onRemoved: WebExtEvent<(changeInfo: _OnRemovedChangeInfo) => void>

Fired when a container is removed.

onUpdated: WebExtEvent<
    (changeInfo: browser.contextualIdentities._OnUpdatedChangeInfo) => void,
>

Fired when a container is updated.

  • Retrieves information about a single contextual identity.

    Parameters

    • cookieStoreId: string

      The ID of the contextual identity cookie store.

    Returns Promise<ContextualIdentity>

  • Deletes a contetual identity by its cookie Store ID.

    Parameters

    • cookieStoreId: string

      The ID of the contextual identity cookie store.

    Returns Promise<ContextualIdentity>

  • Updates a contextual identity with the given data.

    Parameters

    • cookieStoreId: string

      The ID of the contextual identity cookie store.

    • details: _UpdateDetails

      Details about the contextual identity being created.

    Returns Promise<ContextualIdentity>