How can I access a window variable from a chrome extension?
For example, I want my extension to just log window.variable
?
Is this at all possible?
How can I access a window variable from a chrome extension?
For example, I want my extension to just log window.variable
?
Is this at all possible?
You need to inject the script at runtime (as opposed to doing it from the content script). From the injected script use either messages to pass it to the extension, or (easier) write what you need in a DOM element and read it from the DOM (but changing the dom might break the original page) In the official samples shows how to inject the script by writting a tag.
I know this is a dup of the pointed gmail question but that question has a title that makes it hard to know its about injected scripts.