Created
August 25, 2021 00:57
-
-
Save hkitago/49b38f05d509c724a2398e0cb1813e40 to your computer and use it in GitHub Desktop.
injectScript revised edition https://stackoverflow.com/a/62810431/579429
This file contains 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
(function() { | |
'use strict' | |
const newWindow = window.open('') | |
const newScript = document.createElement('script') | |
const injectScript = ()=>{ | |
// The code to inject | |
} | |
newScript.innerHTML = injectScript.toString() | |
newWindow.document.body.appendChild(newScript) | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment