Skip to content

Is it possible to access global JavaScript variables inside user scripts? #998

Answered by uazo
brckd asked this question in Q&A
Discussion options

You must be logged in to vote

in cromite the choice was to separate the injected script from the website environment, technically the script runs in what is called an isolated world, different from the main world of the page.
this is because it allows a different csp to be defined, which for userscripts is script-src 'self'; object-src 'self';
the effect is therefore that no changes can be made outside userscript world.

For example, is it possible to define service workers?

not unless the sw script is static and embedded in a blob.

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@brckd
Comment options

@uazo
Comment options

@uazo
Comment options

@brckd
Comment options

Answer selected by brckd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants