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