function onRemoved() {
console.log("items removed successfully");
}
browser.menus.create({
id: "click-me",
title: "Click me!",
contexts: ["all"],
});
browser.menus.create({
id: "remove-all",
title: "Remove all!",
contexts: ["all"],
});
browser.menus.onClicked.addListener((info, tab) => {
if (info.menuItemId === "remove-all") {
let removing = browser.menus.removeAll();
removing.then(onRemoved);
}
});menus.removeAll() / notebook
menus.removeAll()
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.