Page 1 of 1

Extensions and Pale Moon 25

Posted: 2014-08-19, 12:55
by Moonchild
Since I expect there to be some confusion about the upcoming Pale Moon v25 in terms of extension compatibility, I'm making this announcement to hopefully answer the most common questions about it. Please create a thread in the development discussion board if you think something essential is missing here that needs to be answered.

Which Firefox version is v25 going to be based on?
None. Pale Moon is a hybrid fork of Firefox, and will continue to develop its own source code. Pale Moon 25 will not be based on Firefox 25, nor Firefox 31, nor ESR, nor any other specific Firefox version. I've looked at re-basing the browser on a later code base of Firefox as a starting point, but none of the usable versions have the stability or feature availability that is required for Pale Moon. "Wholesale" porting is therefore ruled out and individual development will continue on the established, stable code base.

How will Pale Moon 25 identify itself to websites?
With a few rare exceptions, Pale Moon will no longer identify itself in the UserAgent as a "Firefox variant" and will no longer list the Firefox Compatibility part along with the Pale Moon specific part.

As an example, if the current version gives websites the following UserAgent in http requests:

Code: Select all

Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.7) Gecko/20140802 Firefox/24.7 PaleMoon/24.7.1
this will become

Code: Select all

Mozilla/5.0 (Windows NT 6.1; WOW64; rv:25.0) Gecko/20141001 PaleMoon/25.0.0
Among other things, this is to (hopefully) put a stop to the plethora of websites that still use UA sniffing, which is a bad idea, and on top of that use it in a very limited and naive way, resulting in Pale Moon users being constantly nagged with "You are using an outdated version of Firefox". (Pale Moon is usually seen as Firefox 24.0, which is almost a year old)
Users will retain full control over their UserAgent in this respect on a site-by-site basis, so people will be able to fine-tune their use to the sites they visit if such sites are unresponsive to requests to fix their scripting.

For extensions this may also be important, if e.g. extensions request on-line data from certain sites that are restrictive. The extensions may have to include a default override for the UserAgent in that case in general.useragent.override.domain.com (for the restrictive domains data is requested of).

Which Firefox version will extensions have to be compatible with?
In general, the UI and feature set of Pale Moon will remain at 24.* level. Most 24.* Firefox extensions will continue to work out-of-the-box, and the Pale Moon extension manager will accept Firefox extensions (with a Firefox GUID) in addition to Pale Moon extensions (with a Pale Moon GUID). The version for Firefox extension compatibility checked against will be 24.9 for Firefox-only extensions.

What is Pale Moon's application GUID from v25 onwards?
The GUID of Pale Moon from version 25.0 onwards will be unique to Pale Moon, and no longer the same as Firefox (for compatibility reasons) like it was before.
The new GUID is:
{8de7fcbb-c55c-4fbe-bfc5-fc555c87dbc4}
Most regular users will not notice this change, but it is a fundamental step and major change for Pale Moon and its development. It may cause unexpected issues in the browser because the Firefox GUID has been used as a hard-coded identifier in many places in the Firefox source code tree (Mozilla shouldn't have, but still did).

What do I need to do to create a Pale Moon specific/compatible extension?
Mainly aimed at add-on developers
Not all Firefox extensions will work in Pale Moon because of the different feature set and slight differences in the UI.
As an add-on developer, you may need to create a Pale Moon specific version of your extension, or add specifically adjusted overlays to your existing Firefox extension.
A few options:
  1. Create a separate, Pale Moon exclusive extension:
    To do this, you need to remove Firefox target application block from your install.rdf, and add a Pale Moon specific one with the Pale Moon GUID, and Pale Moon specific version range (the Pale Moon application version):

    Code: Select all

    		<em:targetApplication><!-- Pale Moon -->
    			<Description>
    				<em:id>{8de7fcbb-c55c-4fbe-bfc5-fc555c87dbc4}</em:id>
    				<em:minVersion>25.0</em:minVersion>
    				<em:maxVersion>25.*</em:maxVersion>
    			</Description>
    		</em:targetApplication>
    IMPORTANT: You should also change the extension's ID in this case to prevent incorrect automatic updates of the extension with an incompatible Firefox one.
  2. Create a hybrid extension that caters to both Firefox and Pale Moon in a single package:
    To do this, you need to add a Pale Moon specific target application block with the Pale Moon GUID and version range, as above.
    Of note is that the Pale Moon GUID is checked first, so any block with Pale Moon GUID will take precedence over the Firefox block. This means that an extension can be compatible with Firefox 16-31, but if the Pale Moon block indicates 25.0-25.* and you try to install it in Pale Moon 26, it will fail if you use strict checking.
    Note, you may also have to take the steps listed in the next point if you use overlays.
  3. Add Pale Moon to a multi-app extension (Create a Mozilla extension that caters to Pale Moon):
    In some cases, Firefox extensions will fail to work properly on Pale Moon as-is because they have defined application-specific overlays (as is the case with a number of add-ons that support Firefox, Seamonkey and Thunderbird in one package). The new GUID means that those overlays (tied to the Firefox GUID in application={}) will no longer apply to Pale Moon and the extension will break because it won't have an overlay for Pale Moon.
    You can continue to supply the Firefox extension as-is with minimal edits, by adding Pale Moon GUID-specific overlays to chrome.manifest in your extension:

    Code: Select all

        # Firefox windows
        overlay chrome://browser/content/browser.xul      chrome://myextension/content/overlay.xul application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
        # Pale Moon windows
        overlay chrome://browser/content/browser.xul      chrome://myextension/content/overlay.xul application={8de7fcbb-c55c-4fbe-bfc5-fc555c87dbc4}
    
If you have created a Jetpack extension that hard-codes application GUIDs in its bootstrap script, then you will, of course, also have to add Pale Moon's GUID to it.