Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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