docs.rodeo

MDN Web Docs mirror

contextualIdentities.onCreated

{{AddonSidebar}} 

Fired when a new contextual identity is created. Contextual identities may be created by extensions using the contextualIdentities API, or directly by the user, using the browser’s user interface.

Syntax

browser.contextualIdentities.onCreated.addListener(listener)
browser.contextualIdentities.onCreated.removeListener(listener)
browser.contextualIdentities.onCreated.hasListener(listener)

Events have three functions:

addListener syntax

Parameters

Browser compatibility

{{Compat}} 

Examples

function handleCreated(changeInfo) {
  console.log(`Created: ${changeInfo.contextualIdentity.name}`);
}

browser.contextualIdentities.onCreated.addListener(handleCreated);

{{WebExtExamples}} 

In this article

View on MDN