In short, I'm working on a Google Chrome extension. Extensions do not have access to variables in the area of the page on which they work by default (you need to exchange data through the DOM).
What I'm trying to do is paste the script into the page; this works fine by defining a script tag and src attribute.
The problem is that this script needs a variable that needs to be initialized in advance. To initialize this variable, I am trying to build a script element with its embedded code (and not with an external source), but I am having problems with its operation.
Is this possible, and if so, how to determine the source inside the script? I tried adding node text containing the JS source to the script element, but to no avail.
source
share