It’s all because of chromebooks. Google has had to implement basically every capability as a js api so Chromebook’s can do real work.
You should have been around before chrome books when any extension could do whatever it wanted without any permissions at all. Your understanding of history is missing some key pieces. Over time, Google has generally locked these APIs down not opened them up.
Browser JS definitely never had the ability to unmount storage volumes before Chromebooks existed.
Oh but your Java applet surely could.
And nothing would prevent an extension from loading an applet
Extensions could, and this action could be triggered from browser JS.
Because browser makers and web app devs want to be able to do everything desktop software can, but inside of a browser.
In theory that's basically like letting anyone on the internet run arbitrary code on your devices which is a terrible idea. In practice it's like letting anyone on the internet run arbitrary code with a few guardrails to catch the worst and most obvious abuses while it takes control away from the user and allows for highly invasive forms of tracking that is very hard to prevent.
In theory, there is no difference between theory and practice; but in practice, there is.
Chrome has a a USB interface; I'm guessing identification and ejectionnis required functionality fir dual-mode USB devices that may present as storage devices foe driver installation.