Reputation: 3338
Is it possible to remove all side effects created from a third party script, without concretely knowing what they are?
Simple toy example:
A script is loaded via a script
tag, it created a new DOM element, and also attaches some data to the window
object.
My application now wants to remove anything this script has created/added to the browser.
Is it possible to delete all the effects?
Upvotes: 0
Views: 214
Reputation: 6597
No, it's not possible. The only way to «remove» all effects from a external script is not loading it in the first place. Even if you target all script elements and delete them, the code would have already been executed.
Upvotes: 1