I also notice people often conflate the problems of overzealous browser-based scripting with JavaScript the programming language. This is pretty understandable since JavaScript has been the only browser scripting option for 2 decades, but those problems would exist no matter what options were available for browser scripting. It's a safe bet to assume that the problems would actually be much worse if JavaScript wasn't the only browser scripting language available since that would mean browser-based scripting would be more accessible to more programmers.
In another 6-8 years when WASM targeting alternatives become more mature we will see a new explosion of browser scripting.