Skip to content

Instantly share code, notes, and snippets.

@hkitago
Created August 25, 2021 00:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hkitago/49b38f05d509c724a2398e0cb1813e40 to your computer and use it in GitHub Desktop.
Save hkitago/49b38f05d509c724a2398e0cb1813e40 to your computer and use it in GitHub Desktop.
injectScript revised edition https://stackoverflow.com/a/62810431/579429
(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