5

In Java there is a notion of "rich client platform" - it's a framework for building desktop applications, provides common features like help browser, window layout management, etc. Prominent frameworks are Eclipse and Netbeans.

Now I am curious if something like that can be done on top of web browser? I heard about XULRunner, Chrome extensions, NPAPI and such but hesitant to dive further (my current idea is to fork Chromium).

Basically, is there a way from a (serverless) browser application:

  1. Work with filesystem (Open/Save/open OS file browser)
  2. Start OS processes (e.g. some utilities) and parse their output.
  3. Access dynamic libraries.
  4. Alter browser UI (e.g. remove home/address bar, redo menus)
  5. Package as something easily deployed throw the app stores.

Can this be done without forking the browser? What should I read about?

Updated Requirements: Essentially I am looking for "PhoneGap for PCs" - but I really like how I could reuse Chromium UI (tabs, preferences, etc) if I forked it. I'm prototyping on Mac, will setup a Linux build. I am not interested in Windows at this point...

Eugene
  • 646

3 Answers3

6

You probably want the Chromium Embedded Framework, which is apparently used by a fair number of high profile applications.

The Chromium Embedded Framework (CEF) is an open source framework for embedding a web browser control based on Google Chrome, it is a convenient way to implement an HTML 5 based GUI in a desktop application or to provide browser capabilities to an application. It comes with bindings for C, C++, Delphi, Java, .NET, Python and runs on Linux, Mac OS X and Windows. (wikipedia)

From the sound of it, you could write the bulk of your application in HTML+JavaScript+CSS, relying on some "host" language to provide access to system resources.


Another option, particularly if your target is non-Windows platforms, is to actually write a web application that either rests on apache or comes with a simple web server, like PHP's built-in web server. Launching the application, in the latter case, would be a matter of invoking both server component and the browser (after the server component picks a port to listen on).


If your target platform were Windows, the concept of a trusted HTML Application has been around for quite awhile. You'd basically write an HTML page (including javascript, vb script, and styling), give it a .hta extension, and it would operate like a trusted application.

http://en.wikipedia.org/wiki/HTML_Application

From there, you'd be able to access Windows Script Host functionality.

That said, if your target environment is Windows, it's probably easier to just build your application with C# in Visual Studio, which is available in an "Express" (free) version.

svidgen
  • 15,252
3

If I'm correct about your plan to make a desktop application, and not actually use the browser itself all that much, then Awesomium or a similar framework may interest you. You're still coding the back-end stuff in C#/C++, or whatever language you prefer, but your UI (the strength of HTML/CSS) can be coded using web technologies.

Also, if you don't mind reducing your target audience to 1/10th, Windows 8 lets you code apps using HTML/CSS/JS.

Katana314
  • 882
0

Now I am curious if something like that can be done on top of web browser?

No you don't. If you start with a browser, you'll have to strip down everything on the browser. If you plan to create a desktop application from web technology, IMO it's more reasonable to start from the rendering engine, which is Webkit or Gecko and their JS engine and build up what you needed from there.

Some IDEs embed a HTML rendering engine for either their web development toolkit or their help viewer. ChromeOS and FirefoxOS are build on the idea that all their native applications are written in HTML/CSS/JS; Windows's Metro apps, Mac's Dashboard Widget, and the old Yahoo Widget are self-contained application written using HTML/CSS/JS. Then there is also Adobe AIR (that's mostly flash though).

Mozilla played around with Prism (no, not that PRISM), which is meant to be a platform for writing desktop application using web technologies, although this project is no longer active. I believe that - instead of bringing web technology to desktop application - they want to bring desktop capabilities to the web instead (i.e. pushing for Canvas, WebGL, Geolocation API, Web Worker, Web Socket, File API, Indexed Database API, ASM.js, etc). Although it's notable that Firefox OS is going to that other direction.

Lie Ryan
  • 12,496