browser.menus.create({
id: "click-me",
title: "Click me!",
contexts: ["all"],
});
browser.menus.onClicked.addListener((info, tab) => {
console.log(`Item ${info.menuItemId} clicked in tab ${tab.id}`);
});menus.onClicked / notebook
menus.onClicked
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.