Search code examples
user-interfacebrowserdesktop-application

Using the browser for desktop UI


How can I use the browser as a UI for a desktop app? The ways I have come up with so far are...

  1. Use all HTML/Javascript. Problem: Can't access filesystem or just about anything else.
  2. Run a local webserver while the application is in use. Problem: How do I kill it when the user is done? My users are not technical enough to Ctrl+C.
  3. Embed a browser component in a regular GUI. Problem: Embedded browser components tend to be glitchy at best. The support for Javascript/CSS is never as good as it is in a real browser.
  4. ...?

The ideal solution would work with any technology. I know there are options like writing Firefox extensions, but I want to have complete freedom in the backend technology and browser independence.


Solution

  • In Windows, you could embed the IE ActiveX control, which uses the same rendering engine as IE. (That's a plus and a minus) You can set the ScriptObject property in your host code and access it in Javascript as window.external to do things that Javascript cannot do.

    If you run a local webserver, you could have an exit link in the app that kills the websever.