Clientside mitigation: install noscript. https://addons.mozilla.org/en-US/firefox/addon/noscript/ You can’t expect to remain secure on the modern web while running arbitrary javascript from anyone and everyone.
Nice: to be secure on the web, you just need to install an add-on which needs to: Access browser tabs Store unlimited amount of client-side data Access browser activity during navigation Access your data for all websites
But uBlock Origin has that functionality, too, and I guess most people who would care about JavaScript have that already enabled anyways.
The web is so much nicer without JavaScript but easily activating it (via cmd-J) once it seems necessary without reloading.