Running the Web Browser Engine Sample Application

The Web Browser Engine comes with a sample GF-based application called Wklauncher that demonstrates the Web Browser Engine API.

Because the Web Browser Engine library uses GF to render, you must ensure that io-display is running and properly configured to use the correct display resolution and color depth.

Wklauncher also requires a devi driver such as devi-hid in order to use keyboard or mouse input. For example:

devi-hid -P mouse kbd

Note: The following procedure assumes that you are running the sample application from a self-hosted system.

Run the sample application

To run the Wklauncher sample:

  1. At the command-line prompt, set the LD_LIBRARY_PATH so that the required shared libraries can be found:
    export LD_LIBRARY_PATH=$QNX_TARGET/opt/webkit/x86/lib:$LD_LIBRARY_PATH
  2. Type the following command to run Wklauncher:
    $QNX_TARGET/opt/webkit/x86/bin/wklauncher url

    where url is the fully qualified URL of the page that you want to launch in the browser.


    Note: Ensure that you have provided a fully qualified URL. The Wklauncher sample does not assume the http:// prefix.

The Wklauncher sample application does not provide a field to enter a URL. You can navigate using your favourite search engine on the Web. Remember that Wklauncher is only a basic sample application designed to show you how to create a browser-based application using the Web Browser Engine API. You can add a navigation bar, as well as other common browser features by using the Web Browser Engine API.

Getting a more responsive mouse pointer

The Wklauncher application uses a hardware cursor to display and move the mouse pointer. On some websites, you may notice that mouse pointer responsiveness is less than ideal. In the interest of keeping Wklauncher event-handling simple, this issue has not been resolved.

One way to solve this issue is to use a separate process to display and move the hardware cursor. QNX Neutrino 6.4.1 provides an example application called gfi-demo that you can run as a separate process to display and move the mouse cursor. You may need to run it at a higher priority to ensure smooth movement when the Web Browser Engine is busy. In some cases you may also need to run devi-hid and or io-hid at a higher priority. The Wklauncher application has a -C command-line option to disable it from displaying the cursor.

The following example launches the Wklauncher sample using the gfi-demo application to render the cursor:

nice --1 gfi-demo &
$QNX_TARGET/opt/webkit/x86/bin/wklauncher -C http://www.qnx.com

Note:

The source code for the QNX CAR web browser launcher is now available. You can download this source to view an example of many of the more advanced techniques for using the WebKit library, including creation and management of multiple WebView instances.

You can download the source code from the following repository on Foundry 27: http://community.qnx.com/svn/repos/web-browsers/qnx/trunk/webkit_kd/