XULRunner integration for SWT browser

This article refers to the codebase of PIM 7.1.04.

Due to a lot of bugs in RichText-Editor area, which were caused by the defective integration of the "Internet Explorer", we switched to the Mozilla browser, which is used now to embed the CKEditor in PIM Desktop. This article describes all knowing benefits, disadvantages and open issues resulting from this change.

XULRunner integration

To make it possible to use the Mozilla browser in the SWT browser control, a XULRunner installation is required. The XULRunner is the rendering engine of the Mozilla browser (Firefox) and can be used by PIM Desktop to embed the Mozilla browser (instead of the IE browser which is default). The XULRunner is an open source project from Mozilla. The releases are downloadable from this page http://ftp.mozilla.org/pub/mozilla.org/xulrunner/releases/. For PIM 7.1 we are using the version 10.0.4 of XULRunner, which is the maximum supported version for Eclipse 3.8 (which is the platform of PIM 7.1). Since PIM 8 we are switching to the XULRunner version 24.0, which is the maximum supported version for Eclipse 4.4. To integrate the XULRunner into PIM Desktop a new plugin was added - com.heiler.ppm.xulrunner.win32.win32.x86 - which just contains the XULRunner runtime. Additionally the plugin initializes the XULRunner before the first SWT browser control is created at the runtime. Furthermore the XULRunnerInitializer adds the "security policy" entries into the user preferences to ensure, that the user is able to use all RichText-Editor clipboard action (like "Copy", "Cut" and "Paste"). This is more or less a workaround due to an Eclipse bug which will not be fixed: https://bugs.eclipse.org/bugs/show_bug.cgi?id=348302

Fixed issues

Following knowing issues were fixed by the swithing to the Mozilla browser for the RichText-Editor:

  • images/infajira.informatica.com/secure/viewavatar.svg HPM-20948 - Cursor is shown twice in two different richtext fields. Closed

  • images/infajira.informatica.com/secure/viewavatar.svg HPM-20647 - Special Characters and text Features aren´t placed at the selected position Closed

  • images/infajira.informatica.com/secure/viewavatar.svg HPM-19913 - sporadic error message during the RTE using "not enough memory in line 1" Closed (<- should be verified at the customer)

  • images/infajira.informatica.com/secure/viewavatar.svg HPM-21535 - Error in rich text editor because IE can't load more than 31 style sheets Closed (<- should be verified at the customer)

  • images/infajira.informatica.com/secure/viewavatar.svg HPM-19978 - Activate spellchecker and copy the text with wrong words in to the RTE, will create an underline for the wrong words. Closed

Open issues

Following issues/side-effects due to the switching to the Mozilla browser are known:

  • If the RTE is in "read only" mode and the "Copy" action is used: a warning dialog pops up with the following message:

    images/download/thumbnails/79562235/image2015-5-7_11_53_11.png

    This is due to the security settings of the Mozilla browser. The workaround desribed above (XULRunnerInitializer) solves this problem for the "edit" mode, but obviously not for the "read only" mode.

  • The focus behavior on using the TAB key is not consistent. Due to an eclipse bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=390806 the Mozilla browser does not release the current focus on pressing the TAB key. We were able to patch the corresponding eclipse component (Mozilla.java). Now the focus will be released if the user presses the TAB key, but sometimes is the tabbing not consistent (e.g. the next RTE field is not focused on tabbing).

  • The focus behavior on switching between the PIM Desktop and any other window (e.g. a separate browser window) is not consistent. Sometimes the browser control remains the focus even when the user clicks into another window. This is due another eclipse bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=84532. By adding a more or less hack to the form view and the RTE control, we were able to limit this bad behavior so that if the user clicks again into the form view (e.g. another editor field as the focused one) there is only one blinking cursor at the same time.

Workaround to prevent the "Invalid Certificate" error

If the browser control loads any URL which uses an unsigned SSL certificate, an error dialog appears:

images/download/attachments/79562235/image2015-11-19_13_54_43.png

Since there is no way to add an "exception" to the XULRunner, the following workaround can be used:

  1. Open Firefox and load the domain which uses the invalid certificate (i.e. "https://localhost:8443/")

  2. The page "This connection is untrusted" will be shown (see below):

    images/download/thumbnails/79562235/image2015-11-19_14_12_44.png
  3. Click on the button "Add exception..." and confirm the dialog which appears

  4. Go to the "Firefox" profile folder (typically "C:\Users\[USER_NAME]\AppData\Roaming\Mozilla\Firefox\Profiles\[PROFILE_NAME]\")

  5. Copy the file "cert_override.txt"

  6. Go to the XULRunner profile folder (typically "C:\Users\[USER_NAME]\AppData\Roaming\Mozilla\eclipse\")

  7. Paste the file "cert_override.txt"

Next time you start PIM Desktop the browser control will load the URL without any errors.

Alternatively just use a "trusted" certificate (see https://en.wikipedia.org/wiki/Certificate_authority) or switch the setting http.client.proxy in "server.properties" to a HTTP URL (instead of HTTPS).

Preference to specify the default browser

Due to the changes described above (integration of Mozilla browser) there is a new client preference - defaultBrowser - which can be used to specify the default browser type used for the browser control. The default value of this preference is "mozilla". If set to "ie" the "Internet Explorer" will be used as a default browser.

com.heiler.ppm.std.ui/defaultBrowser = mozilla

Performance enhancement

An additional benefit of the replacing the browser control is the performance enhancement on the execution of the JavaScript code. See the statistiks below to compare the performance of the "Internet Explorer" and Mozilla browser (Firefox):

images/download/attachments/79562235/peackeeper.png images/download/attachments/79562235/kraken.png images/download/attachments/79562235/octane.png images/download/attachments/79562235/speedometer.png