ActiveX and Java Web Start, etc all tried to do this, and all of them ended up deprecated and out of favor for native web solutions.
Java IDEs did a lot of this for many years (Eclipse, IntelliJ, NetBeans, JDeveloper, etc) and they worked reasonably well on the desktop, but had no path to offering a web hosted solution (like gitpod or codespaces)
There are not a lot of options here, compiling down a native solution to wasm and running it in the browser would work, I'm not sure if the performance would be substantially better or more consistent across all OS'es and web unfortunately.
So we are where we are :)
Not really. Electron is basically web browser.
The issue is that a cornerstone of modern development is basically "don't rewrite what already has been written", however the problem is that you always get optimization creep because of this - people just build shit on top of other shit continuously and never go back and optimize.
Qt is pretty good at this actually. I don’t have a Mac, but building the same codebase for windows, linux, and a wasm target was pretty neat the first time I did it.