Is there a way to have some small application that talks to the machine via a set of HTTP apis?
I envision something where you can just use your regular web app, have the user install the "Desktop Connector" which would be listening at say, port 8000 - then your web app can talk to the desktop via those APIs, instead of installing an Electron or related.
I must be missing/forgetting something crucial since that seems like the most straightforward solution imaginable.
Dell uses this exact technique on Windows to launch/interact with their driver installation tool from the web. That has decent UX because it comes pre-installed. But, generally, users aren't accustomed to this pattern and any user education requirement is often a non starter in many market segments.
It also has security implications if you are exposing OS functionality to websites. I remember Dell having a bad one a couple years ago.
There is also an antivirus browser extension that works in a similar way. It installs a native C++ executable that the extension interacts with. That has a huge security footprint. IIRC they rolled their own parser (HTML?, JSON?) and it went predictably bad.
There are lots of implications to consider. I'd like to see progressive web apps fill this niche on the desktop. They have various mechanisms for persistence of data and WASM will increase the practical use cases. Hopefully the APIs available to PWAs in the future will allow all sorts of new use cases.
I mean you are basically just describing a standard local development setup, so in a lot of ways this is trivial. The trouble would be trying to package that up in user-friendly manner. It's definitely more work than it's worth, in a world where most people have computing resources to spare on a heavy framework like Electron.
There's nothing stopping you from doing this with a server on localhost. You just need to think a bit about security (and be extra careful if you're running a websocket server since they don't do origin checks by default).
the HTML5 JS APIs provide most desktop functionality you could want to access from the browser - does that cover what you mean? Reading location, video & audio, interacting with local files, that sort of thing.
I envision something where you can just use your regular web app, have the user install the "Desktop Connector" which would be listening at say, port 8000 - then your web app can talk to the desktop via those APIs, instead of installing an Electron or related.
I must be missing/forgetting something crucial since that seems like the most straightforward solution imaginable.