I posted a topic about this recently. Now I've written an essay about it:
https://onpon4.github.io/other/kill-js/
I've come to the conclusion that making JavaScript code libre is the wrong
direction to take. I think automatically installed JavaScript should just be
rejected, and I have started doing so.
By the way, a useful trick: one common use of JavaScript code is to show
elements that are hidden by default (spoiler tags, for example). You can
right-click on such elements, choose "Inspect Element", and modify the CSS
display attribute from "none" to "" (or just get rid of the part that
modifies the display attribute). It takes a couple seconds, so it's obviously
less convenient than using the JavaScript code, but it's very easy. The
Inspect Element feature can also be useful for other things, like floating
boxes that block text.