contextualIdentities API
Use the browser.contextualIdentities API to query and modify contextual identity, also called as containers.
Permissions
Functions
create(details)
Creates a contextual identity with the given data.
Parameters
details
(object)
Details about the contextual identity being created.
color
(string)
The color of the contextual identity.
icon
(string)
The icon of the contextual identity.
name
(string)
The name of the contextual identity.
Required permissions
Retrieves information about a single contextual identity.
Parameters
cookieStoreId
(string)
The ID of the contextual identity cookie store.
Required permissions
Reorder one or more contextual identities by their cookieStoreIDs to a given position.
Parameters
cookieStoreIds
(string or array of string)
The ID or list of IDs of the contextual identity cookie stores.
position
(integer)
The position the contextual identity should move to.
Required permissions
query(details)
Retrieves all contextual identities
Parameters
details
(object)
Information to filter the contextual identities being retrieved.
[name
]
(string, optional)
Filters the contextual identity by name.
Required permissions
Deletes a contextual identity by its cookie Store ID.
Parameters
cookieStoreId
(string)
The ID of the contextual identity cookie store.
Required permissions
Updates a contextual identity with the given data.
Parameters
cookieStoreId
(string)
The ID of the contextual identity cookie store.
details
(object)
Details about the contextual identity being created.
[color
]
(string, optional)
The color of the contextual identity.
[icon
]
(string, optional)
The icon of the contextual identity.
[name
]
(string, optional)
The name of the contextual identity.
Required permissions
Events
onCreated
Fired when a new container is created.
Parameters for onCreated.addListener(listener)
listener(changeInfo)
A function that will be called when this event occurs.
Parameters passed to the listener function
changeInfo
(object)
Contextual identity that has been created
Required permissions
onRemoved
Fired when a container is removed.
Parameters for onRemoved.addListener(listener)
listener(changeInfo)
A function that will be called when this event occurs.
Parameters passed to the listener function
changeInfo
(object)
Contextual identity that has been removed
Required permissions
onUpdated
Fired when a container is updated.
Parameters for onUpdated.addListener(listener)
listener(changeInfo)
A function that will be called when this event occurs.
Parameters passed to the listener function
changeInfo
(object)
Contextual identity that has been updated
Required permissions
Types
ContextualIdentity
Represents information about a contextual identity.
object
color
(string)
The color name of the contextual identity.
colorCode
(string)
The color hash of the contextual identity.
cookieStoreId
(string)
The cookie store ID of the contextual identity.
icon
(string)
The icon name of the contextual identity.
iconUrl
(string)
The icon url of the contextual identity.
name
(string)
The name of the contextual identity.