I don't understand why the functionality exists for websites to dictate how users can and cannot view a page in the first place. This is like if you were reading a book that detected if you were trying to use a magnifying glass and immediately caused a glare to appear to prevent you from being able to read it. It is fucked up.
To use your book analogy - the web is no longer a bunch of books on a shelf, it's an AR device that shoots lasers into your eye. The net effect may be the same in many use-cases, but not necessarily, and malicious actors now have far more flexibility and power because we've all become accustomed to running random code we download off the internet with a single click.
I am, obviously, not a huge fan of this shift and think a large majority of sites could operate perfectly well under the "markup document" model without needing actual code-execution privileges, or more than a minimal set of code-execution privileges for those actual simple document-related use-cases. Go back to being mostly just a book, basically.
Almost all of the use-cases that javascript gets used for in a document context could really be replaced by navigation between sets of linked, static pages (perhaps embedded where needed) - boy, what an idea. If you delivered a site "as a gzip" then there should barely be any noticeable size difference from that anyway, especially compared to downloading mountains of JS embeds.
The amount of things that truly, truly need interactivity is pretty low - things like chat clients come to mind, but does your bank need to be running javascript on your end? Probably not.