-
-
Save elbywan/2d73c7e27d0df8dfe193dbd440cb845c to your computer and use it in GitHub Desktop.
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
// Assume that this code is executed inside the mutation observer callback: | |
addedNodes.forEach(node => { | |
// See above for script tag checks… | |
// Blocks the script tag execution in Safari, Chrome, Edge & IE | |
node.type = 'javascript/blocked' | |
// Unnecessary, but cleaner: remove the node from the DOM | |
node.parentElement.removeChild(node) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment