Last active
December 15, 2015 04:09
-
-
Save airportyh/5199939 to your computer and use it in GitHub Desktop.
What to do to get at global JS variables on the page from a Chrome extension.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var code = '(' + function(){ | |
| window.postMessage({ | |
| globals: Object.keys(window) | |
| }) | |
| } + '())' | |
| var script = document.createElement('script') | |
| script.text = code | |
| document.head.appendChild(script) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment