I have a firefox extension:
background_script.js:
const textVar = "some text"
browser.menus.create({
id: "selection-to-tg",
title: "send selection",
type: "normal",
contexts: ["selection"],
});
browser.menus.onClicked.addListener((info, tab) => {
if (info.menuItemId === "selection-to-tg") {
browser.windows.create({
url: "popup.html",
type: "popup",
width: 500,
height: 400,
left: 200,
top: 200,
});
}
});
How do I pass textVar to the popup.html, or how can popup.html read textVar?