I have this code in the popup.js file on my Chrome Extension:
chrome.scripting.executeScript({
target: { tabId: tab.id },
function: myFunc,
});
function myFunc() {
// do something
}
However, I would like to pass a parameter from the executeScript to myFunc. Something like this:
chrome.scripting.executeScript({
argument: {"arg1", "arg2"}
target: { tabId: tab.id },
function: connectCmd,
});
function myFunc(arg1: string, arg2: string) {
// do something
}
or something equivalent. Is there any way to do this?