async function toggleWebNotifications() {
let current = await browser.browserSettings.webNotificationsDisabled.get({});
console.log(`Current value: ${current.value}`);
browser.browserSettings.webNotificationsDisabled.set({
value: !current.value,
});
}
browser.browserAction.onClicked.addListener(() => {
toggleWebNotifications();
});browserSettings.webNotificationsDisabled / notebook
browserSettings.webNotificationsDisabled
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.