Hi, I'm struggling with a devilish issue.
So, I run a function from my popup using `chrome.scripting.executeScript`, invoking it like this:
```
await chrome.scripting.executeScript({
target: { tabId, allFrames: true },
func: inPageFunction,
});
```
So far so good. inPageFunction can interact with the current tab, and everything seems to work, so I know my permissions are correct.
Here's where the problem lies:
If inPageFunction tries to access a global variable that is set by site on the window/globalThis object, it comes back undefined.
```
function inPageFunction() {
console.log(window.theGlobal); // gives undefined
}
```
However, if I open the console on that site, and run `console.log(window.theGlobal)`, I get a result.
The executeScript is invoked by a button in the popup. I'll hit the button, check the console, and see it has outputted "undefined". I'll then immediately run `console.log(window.theGlobal)` and see theGlobal is indeed defined.
Does my content script not have access to the full window/globalThis object? Is it filtered in some way? I can't figure this out. Any help would be appreciated.
(Manifest v3, btw)
Marc