3 ms·
Often you can think of how the code you want to stop probably works and then bypass it a different way. Change the id/classes on the element that code applies
by Brybry 5y ago
Often you can think of how the code you want to stop probably works and then bypass it a different way.
Change the id/classes on the element that code applies to.
Make a copy of the elements, delete the original, and insert the copy. Then reimplement any JS that's actually needed yourself. Use fetch API if you need an original version of the HTML before JS.
Override getters/setters of properties on elements/nodes. The offending JS can make all the calls it wants but that doesn't matter if you control what the calls do. (Or similar redefinition/extension/hooking of base JS classes).
Web 2.0/widespread use of closures/minification/libraries like React made userscripting a lot more work. It was nice when you could easily hook/wrap anything :(