Closed SmokeFrog981 closed 2 years ago
Instead of changing the source of existing scripts, try adding new script tags with the desired sources, then the custom external scripts will be used.
That's how to add your own custom external scripts, but removing the existing scripts isn't that easy. You could of course remove their tags but the code in them will have already executed by that time. If those existing scripts perform a one-time action, then you could maybe revert that action (e.g. If those scripts inject an image, you could programmatically remove that image.). And if those scripts are constantly running somekind of loop, then you could maybe break the loop somehow.
Another way to stop those original scripts from executing (which doesn't involve injecting code using this extension) is completely blocking communication with their source. (e.g. with firewall rules).
Hope this helps :)
Here is the code
class MyTest { constructor() { var scripts = document.getElementsByTagName("script");
}
setTimeout(function() { let yeet = new MyTest(); yeet.mlg(); }, 3000);
The scripts in the external site were not used once the page is loaded. Any ideas?