I wrote a little framework for this: https://github.com/jdarpinian/web-ui-skeleton
I wrote a little framework for this: https://github.com/jdarpinian/web-ui-skeleton
Running inside a real browser also limits the keyboard shortcuts you can use, because you don't want to clash with the browser's own shortcuts.
The obvious way to keep the browser authenticated is a session cookie. But cookies are shared between all ports on a domain, so a local attacker who tricks you into visiting another localhost service in the same browser can steal the cookie. localStorage doesn't have that issue, but it's not so convenient for authenticating requests.
This is getting weird very quickly (not to mention that Ctrl-S in browser windows saving file without confirmation is a UX I wouldn't want to use)
There are several decent options. You could build a modal that displays a view of the file system sourced from the server. Or you could pop a real native file dialog from the server, and I'm betting it's possible to either make it a real modal of the browser window or do a good enough simulation depending on platform. Or in the future you could use the native file system API that is currently in origin trial.
I submit that this is not weirder than most cross-platform UI toolkits that implement their own whacky replacements for the native file dialogs.
See https://www.w3.org/TR/secure-contexts/#is-origin-trustworthy
Exposing a HTTP port with application state is a million times worse for security