function onCreated(context) {
console.log(`New identity's ID: ${context.cookieStoreId}.`);
}
function onError(e) {
console.error(e);
}
browser.contextualIdentities
.create({
name: "my-thing",
color: "purple",
icon: "briefcase",
})
.then(onCreated, onError);contextualIdentities.create() / notebook
contextualIdentities.create()
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.