function onGot(contexts) {
for (const context of contexts) {
console.log(`Name: ${context.name}`);
}
}
function onError(error) {
console.error(error);
}
browser.contextualIdentities.query({}).then(onGot, onError);contextualIdentities.query() / notebook
contextualIdentities.query()
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
function onGot(contexts) {
for (const context of contexts) {
console.log(`Name: ${context.name}`);
}
}
function onError(error) {
console.error(error);
}
browser.contextualIdentities
.query({
name: "my-thing",
})
.then(onGot, onError);