browser.commands.onCommand.addListener((command, tab) => {
if (command === "duplicate-tab") {
browser.tabs.duplicate(tab.id);
}
});onCommand / notebook
onCommand
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.