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