Skip to content

Instantly share code, notes, and snippets.

@elbywan
Last active June 8, 2018 09:21
Show Gist options
  • Save elbywan/5f554606e4bfaff5d7efd59f77d86cc0 to your computer and use it in GitHub Desktop.
Save elbywan/5f554606e4bfaff5d7efd59f77d86cc0 to your computer and use it in GitHub Desktop.
// Assume that this code is executed inside the mutation observer callback:
addedNodes.forEach(node => {
// See above for script tag checks…
// Safari has this additional event which prevents scripts from loading
const beforeLoadListener = function (event) {
event.preventDefault()
})
node.addEventListener('beforeload', beforeLoadListener)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment