App/UI/HTML Browser

From XOWA: the free, open-source, offline wiki application

The HTML Browser is a core part of the XOWA application.

Overview

The XOWA GUI application embeds a web browser to show the wiki pages.

HTTP Server

XOWA HTTP Server does not use the embedded XOWA web browser.

Android

XOWA droid uses the built in WebView that comes with Android.

SWT

XOWA uses SWT for its Web Browser across all 3 major operating systems: Windows, Linux, Mac OS X.

SWT provides 3 different modes for its Web Browser: mozilla, webkit and none. These can be configured through /xowa/user/anonymous/app/os_name.gfs with the following snippet:

app.gui {
  browser_type = 'mozilla';
}

More information on the 3 modes are below

Mozilla (XULRunner)

Background

XULRunner is a runtime package provided by Mozilla that can be used to build Firefox-like applications. It can be deployed in a standalone package that does not interfere with any installed versions of Firefox.

The download location for xulrunner is http://ftp.mozilla.org/pub/mozilla.org/xulrunner/releases/

XOWA includes xulrunner at /xowa/operating_system_name/xulrunner . For example, on Linux 64-bit, this folder is at /xowa/linux_64/xulrunner/

XOWA can use different versions of xulrunner with something like the following snippet:

app.gui {
  browser_type = 'mozilla';
  xul_runner_path = '~{<>bin_plat_dir<>}xulrunner_v24';
}

ESR limitation

Mozilla Firefox has Extended Support Releases (ESRs). These start at version 10 and occur at 7-step intervals: 10, 17, 24, 31, 38.

Each version of SWT limits compatibility to a specific XULRunner ESR. For SWT version 4.5, the highest XULRunner is 31. Also, non-ESR versions are not allowed. For example, SWT will fail if using XULRunner v30.

WebKit

SWT can also be configured to use the system's default WebKit browser. In most cases, this relates directly to Safari and is easiest done on a Mac OS X system. It can be done for Linux / Windows, but further steps need to be taken. See https://www.eclipse.org/swt/faq.php#howusewebkit

XOWA may support WebKit on Linux / Windows at a future date, but for now, it is not a backlog item. If you are interested, please contact me and I will reevaluate.

If you're on Linux, and want to experiment, you can try the following:

  • Open the following file in your text editor: /xowa/user/anonymous/app/os.linux_64.gfs
  • Change browser_type to webkit. When you're done, it should look something like this:
app.gui {
  browser_type = 'webkit';
}
  • Run XOWA

Note this may not work on systems with proper webkit support.

None

SWT can also be configured to use the system's browser through the keyword "none". For all intents and purposes, this basically applies to using Internet Explorer on Windows machines.

XOWA does not support Internet Explorer. It may do so in the future, but it would be dependent on the ease of the Javascript / CSS integration.

Current state of the SWT HTML Browser by operating systems

Windows

As of v2.6.5, XOWA uses XUL Runner 24 for both Windows 32 bit and Windows 64.

XULRunner 31 does work with Windows XP and Windows 7, but there have been reports of failure on Windows 8. As a result, 24 is the official package.

There is one known issue wherein an error message appears in the console: 1435372844657 addons.manager ERROR startup failed: [Exception... "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIPrefBranch.setCharPref]" nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)" location: "JS frame :: resource://gre/modules/AddonManager.jsm :: AMI_startup :: line 645" data: no] Stack trace: AMI_startup()@resource://gre/modules/AddonManager.jsm:645 < AMP_startup()@resource://gre/modules/AddonManager.jsm:2318 < AMC_observe()@resource://gre/components/addonManager.js:55 < <file:unknown>

However this appears to be benign. There is also currently an open bug on it. https://bugs.eclipse.org/bugs/show_bug.cgi?id=466391

Neither WebKit nor None are supported on Windows.

Mac OS X

As of v2.6.3, XOWA uses WebKit for Mac OS X.

The app package also includes XULRunner 31, but this is not enabled by default. The main issue is that mouse events are not relayed from XULrunner to SWT: https://bugs.eclipse.org/bugs/show_bug.cgi?id=246830 . As a result, mouse hover does not work, and XOWA popups will not show.

WebKit appears to be mostly functional, but it doesn't handle cursor changes. Hovering over a link won't change the cursor to a hand cursor. This appears to be an SWT issue, though the only known ticket is closed: https://bugs.eclipse.org/bugs/show_bug.cgi?id=237562

The None mode is not supported on Mac OS X

Linux

As of v2.6.5, XOWA uses XULRunner 24 with Linux.

Unfortunately, XULRunner 31 is not yet implemented by SWT. See: https://bugs.eclipse.org/bugs/show_bug.cgi?id=437700

Furthermore, XULRunner 24 requires GTK3 to be disabled since XULRunner is not yet ported to GTK3. See: https://bugs.eclipse.org/bugs/show_bug.cgi?id=423870

XOWA accomplishes this by running the following in the xowa_linux_64.sh file "export SWT_GTK3=0 && java -jar xowa_linux_64.jar"

Neither WebKit nor None are supported on Linux.

Namespaces

XOWA

Getting started

Android

Help

Blog

Donate