Of course, on the majority of websites I am not doing any interactions where that would be necessary to me in the first place, and on the majority of websites where JavaScript is used, it's used with little mind towards privacy.
That it isn't inherently evil is a pretty toothless argument that fundamentally doesn't address the proposed solution you're responding to. The fact that the web is a cesspool of scripts ranging from completely useless to directly user-hostile isn't nullified by use cases that are so rare that you from the top of your head can apparently only hypothesize about them.
There seems to be something wrong with a world in which it is in some ways easier/safer to run an untrusted binary, by putting it in a container, than an untrusted web page. You can of course put the browser in a container, but it's crazy that we have to resort to that.
Thanks to Spectre and Meltdown, if you want to be really safe when running untrusted code, you need separate hardware.
But in general: I suppose what we need is a flexibly configurable JavaScript engine that stops and asks permission before any suspicious operation is performed. I don't know enough about JavaScript to know whether or how that might work. I note that the way tujavortaro.net downloads a dictionary is by adding a <script> element to the head of the document (https://gitlab.com/sstangl/tuja-vortaro/-/blob/master/app.js...). HTML+JS is naturally self-modifying, so it's hard to do a static analysis.
Your book-search idea is interesting. Another way is simply to display the list on the web page, minimally marked up, and let the user search using the text search in all browsers - no JS needed. Might be a sizeable page though.
There may be better ways that don't involve sucking bandwidth to deliver a huge list. Bloom filters? I dunno, needs thought and I'm busy - what do you reckon?
But your idea still needs JS. I'm fine with JS if I knew it was doing something minimal and it was highly constrained. That's the problem, not so much running JS as trusting it when it comes from somewhere unknown.
Keep up the good thinking though!
I've been playing with this idea recently. If you want to provide access to a database which is infrequently updated and no bigger than a few megabytes (like the catalogue of a library with 30 000 books), then provide the database with the web page and implement the search function in JavaScript. If you avoid using a JavaScript "framework" then you may find that the web page responds to your typing so instantaneously that you feel like you're back in the 1980s using a Z80-based machine. (You remember those Z80-based word processors that could keep up with a competent typist?)