Overview of the Web Browser Engine

This Overview of the QNX Web Browser Engine describes the following:

What is the Web Browser Engine?

The QNX Web Browser Engine is based on the WebKit open source web browser engine.

For more information on the Webkit open source web browser project, see:

The Web Browser Engine provides a set of core classes that you can use to display web content in a window. By default, the Web Browser Engine implements the most basic functionality of a browser, such as the ability to follow links and the ability to download and display content. You can use the provided functionality of the Web Browser Engine at the most basic level to display web content in your application, or you can use the Web Browser Engine API to create your own full-featured, customized, web-based application.

Downloading and browsing content from the Web can be a fairly daunting task for a browser, given the wide variety of content and encoding types in use on the Internet. The Web Browser Engine handles these different content types transparently by creating and managing the objects necessary to render the incoming content. The Web Browser Engine provides view classes that are used to display content. Each view class (called a WebView) contains frames, called WebFrames with each frame implementing it's own scrollbar. You do not need to implement custom views or custom frames in order to display content in your application.

For more information, see the WebView and WebFrame classes.

If you do want to create a custom browser application, you can implement the provided delegate objects to handle client requests, resource loading, content downloading, and general user interface look and feel. Delegates are used to intercept messages and make decisions based on how you want the browser to look or behave in certain situations. The Web Browser Engine provides a WebNotificationDelegate class that you can extend to override default notification behavior. For instance, the WebNotificationDelegate class contains methods that are called when pages are loaded and when a user hovers over a frame.

For more information, see the WebNotificationDelegate class.

Organization of the Web Browser Engine

The $QNX_TARGET/opt/webkit/ directory contains the Web Browser Engine library and a simple Graphics Framework-based example browser application. The directory has the following file structure:

processor/bin
Contains the wklauncher application. The wklauncher sample is included to provide an example of a simple Web Browser Engine-based application.
processor/lib
As wklauncher runs, it loads the Web Browser Engine library, and various third-party shared libraries that are not shipped with 6.4.1. These are located here.
etc/fonts
Contains font configuration files, including fonts.conf. These are used by the third-party libfontconfig library, which in turn is used by the libfreetype library. The FONTCONFIG_PATH environment variable can be used to tell libfontconfig which directories to search for fonts.conf and other configuration files. Use a colon to separate multiple path names. By default, the wklauncher sample browser will look in /opt/webkit/etc/fonts or $QNX_TARGET/opt/webkit/etc/fonts. You can override these locations.

Note: Note that the fonts.conf file contains a font directory list, which currently contains only /usr/photon/font_repository. You should change this location to the actual location of your TrueType font files.

ssl
Contains a Root certificate bundle used by the Web Browser Engine to access most secure web sites. You can specify the full path name of this file by using the CURLOPT_CAINFO environment variable. By default, wklauncher uses the name /opt/webkit/ssl/ca-bundle.crt. If this file does not exist it will use $QNX_TARGET//opt/webkit/ssl/ca-bundle.crt. You can override this filename by setting the CURLOPT_CAINFO environment variable yourself.
webkit
Contains images used for the buttons displayed by wklauncher. These PNG files must be located in one of the following two directories: /opt/webkit/webkit/, or $QNX_TARGET/opt/webkit/webkit/.

Web Browser Engine supported features

The Web Browser Engine has support for the following features:

The Web Browser Engine supports the following encodings:

The Web Browser Engine supports the following character sets:

Building Your Own Web Browser Engine-based Browser

Source code for the Web Browser Engine library and wklauncher sample browser is available in the QNX Foundry27 “web-browsers” project. Currently, when you build your own browser application, you must also build the Web Browser Engine library.

The SVN repository is called “web-browsers”, and is divided into Web Browser Engine source and third-party support library source. The top-level of the trunk of the Web Browser Engine respository location contains a README file with further instructions on how to build the Web Browser Engine using either Linux or Neutrino SDP 6.4.

Note that the source code for the wklauncher sample browser can be found here: [web-browsers]/webkit/trunk/WebKitTools/OWBLauncher/Gf/main.cpp

Web Browser Engine Reference Application

The Web Browser Engine comes with a reference application that you can use to build your own custom browser-based application.

For information on running the Web Browser Engine sample application, see Running the Web Browser Engine Sample Application.