Question

I am working on a desktop software for a client and I was thinking for the UI, I would use standard web technologies like HTML5+JS and was planning to simply package in a headless version of a modern browser like Chrome/Firefox with my software. For example, it would be just the page-viewer/rendering-engine part of the browser without borders/menues/tabs/shortcuts/profiles etc. What is the easiest way to accomplish this in a platform independent way. I know Mozilla had projects like Prism/Chromeless but they have not been updated in over a year.

Was it helpful?

Solution 9

Electron is the best for this these days: http://electron.atom.io/

OTHER TIPS

Have you considered the XUL language from Mozilla? It is the XML language used in Mozilla projects to build their user interfaces. It is rendered by their gecko engine in a standalone Mozilla Xulrunner, which can be packaged with your XML and javascript into an executable package.

If size isn't a problem you can use titanium from http://www.appcelerator.com/
It runs on almost every platform. That's what they use to build wunderlist. http://www.6wunderkinder.com/wunderlist/
If you care about size, you could build a simple wrapper, that starts the user's preferred Browser without any controls and toolbars.

QtWebkit should be a reasonable choice. You can make a simple application with Qt SDK or QtCreator. You can embedded the HTML/CSS/JS into application within the Qt resource file. Please check the source code below:

#include <QtGui/QApplication>
#include <QWebView>
#include <QNetworkProxy>

class MainWin : public QWebView
{
public:
    explicit MainWin(QWidget * parent = 0) {
        m_network = new QNetworkAccessManager(this);
        // Setup the network proxy when required!
        //m_network->setProxy(QNetworkProxy(QNetworkProxy::HttpProxy, "10.1.1.80", 80));
        page()->setNetworkAccessManager(m_network);

        // You can use the internal HTML/Javascrip/CSS by 
        // specify qrc:// URLs refer to resources. See resource.qrc
        QUrl startURL = QUrl("http://www.google.com");

        // Load web content now!
        setUrl(startURL);
    }
private:
    QNetworkAccessManager * m_network;
};

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    MainWin w;
    w.show();

    return a.exec();
}

This is a working example with a window frame! Look like this! It is working just as a browser.

have you looked at Adobe AIR ?

I think I would go for Arora in your case. It has not been maintained since 2010, but assuming it runs stable as is, it has some great pros:

it runs on a impressive number of platforms and has good HTML and Javascript compliance, since it's based on Webkit. (Which Apples Safari is built upon.) Also, any minor issues could probably be worked around, since you are supposedly developing your application more or less from scratch. The upside of going for an approach such as yours, is also that you can pretty easily replace the bundled browser with something else in the future, should that suit you.

Or use Qt, which is very cross platform and can also embed Webkit.

I'm the past I've used WebKit for this purpose (relying on the system WebView control in Cocoa, and using Brent Fulgham's Cairo port of WebKit for Windows).

The WebKit project on webkit.org includes that port (and Qt and GTK+ and many others).

I suggest Adobe AIR. I saw you mentioned that you don't like Adobe products and their expensive IDEs. However, AIR is free, and you can use any IDE that you see fit (Aptana is a good choice built on top of Eclipse).

I've done a music player with Adobe AIR. That was around a year ago, and since then they have released Adobe AIR 3. The full feature list is very long, but, in short, it supports both the usual browser stuff (JS, Flex, etc.) and some native things. E.g., you can browse files on the computer or display PDFs. Well worth a try.

Must it be one browser? Consider using webkit on OSX and IE on windows. Then you can make a small wrapper with a small interface. The benefit is you don't have to package your own browser, but use what is provided by the operating system resulting in a smaller program.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top