async function setOnActiveTab() {
let tabArray = await browser.tabs.query({
currentWindow: true,
active: true,
});
let tabId = tabArray[0].id;
await browser.sessions.setTabValue(tabId, "my-key", "my-value");
}
browser.menus.create({
id: "my-item",
title: "my item",
contexts: ["all"],
});
browser.menus.onClicked.addListener(setOnActiveTab);sessions.setTabValue() / notebook
sessions.setTabValue()
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.