Is it possible to remove script tags in the of an HTML document client-side and prior to execution of those tags?
On the server-side I am able
You could try to use the DOM Mutation events:
DOMAttrModified
DOMAttributeNameChanged
DOMCharacterDataModified
DOMElementNameChanged
DOMNodeInserted
DOMNodeInsertedIntoDocument
DOMNodeRemoved
DOMNodeRemovedFromDocument
DOMSubtreeModified
like so:
document.head.addEventListener ('DOMNodeInserted', function(ev) {
if (ev.target.tagName == 'SCRIPT') {
ev.target.parentNode.removeChild(ev.target);
}
}, false);
Also you can try the new way of doing this through MutationObserver