About changes in YARIP: compatibility with Pale Moon 29.x

One user asked me in a private message on the Pale Moon forum what changes have I performed to the YARIP extension by Kim A. Brandt in order to have it work in Pale Moon. Since their PM receipt is was disabled I decided to publish the details here in case the forum admins would have a problem with me publishing those details there.

The version I “hacked” and used for many years is, which is not the latest; at the time it was either the latest available or the latest compatible with my browser version.

OK, let’s roll. First of all the “classic” RDF “hack”- adding the PM GUID. This has to be done in two stages due to the layout of the file. Open install.rdf for editing.
First insert the string in red in the original code:

<em:targetApplication RDF:resource=”rdf:#firefox”/>
<em:targetApplication RDF:resource=”rdf:#palemoon”/>
<em:targetApplication RDF:resource=”rdf:#thunderbird”/>

Then add the following red string somewhere below after the string </RDF:Description> that ends the first block; it’s OK to use the position hinted below:

<RDF:Description RDF:about=”rdf:#firefox” em:id=”{ec8030f7-c20a-464f-9b0e-13a3a9e97384}” em:minVersion=”17.0″ em:maxVersion=”28.0″/>
<RDF:Description RDF:about=”rdf:#palemoon” em:id=”{8de7fcbb-c55c-4fbe-bfc5-fc555c87dbc4}” em:minVersion=”25.0″ em:maxVersion=”29.*”/>
<RDF:Description RDF:about=”rdf:#thunderbird” em:id=”{3550f703-e582-4d05-9a08-453d09bdfdc6}” em:minVersion=”17.0″ em:maxVersion=”28.0″/>

The original RDF has all similar data in a single line separated by spaces as above, which is fine by browser’s standards but not very human-readable, so I had formatted it a bit at the time. Either way is fine.

Last (for this file) is changing the version number, which is mostly for visual feedback, so that we know we have the modified version installed instead of the official one.
Look for the text version=”” and replace the version number with something slightly higher; personally I used (so it would look like version=”″). Remember there is a higher version available ( but I have not tried to modify that one and therefore don’t know if the same would work there. It’s best not to confuse the browser with bad version numbers so don’t use anything higher than 0.3.5 for the modified 0.3.4.

Then, the same GUID has to be added to chrome.manifest; personally I added the code between the #Firefox and #Thunderbird sections but it can also be added at the bottom or anywhere after the last resource statement:

# Firefox
overlay chrome://browser/content/browser.xul chrome://yarip/content/overlay.xul application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}

# Palemoon
overlay chrome://browser/content/browser.xul chrome://yarip/content/overlay.xul application={8de7fcbb-c55c-4fbe-bfc5-fc555c87dbc4}

# Thunderbird
overlay chrome://messenger/content/msgHdrViewOverlay.xul chrome://yarip/content/messenger.xul application={3550f703-e582-4d05-9a08-453d09bdfdc6}

The last code change is a tiny bit more challenging since it’s in the middle of a large code file. However a careful person can do it without problems.
Open the file chrome/content/overlay.js for editing. The following block of code has to be inserted immediately below line 613 so it’d be advised to use an editor that can count and display line numbers.
For orientation, the block is to be inserted right before the line: case “{3550f703-e582-4d05-9a08-453d09bdfdc6}”: // Thunderbird

case "{8de7fcbb-c55c-4fbe-bfc5-fc555c87dbc4}": // Palemoon
this.getAppcontent = function() { return document.getElementById("appcontent"); };
this.getBrowser = function() { return gBrowser; };
this.getContextMenuId = function() { return "contentAreaContextMenu"; };
this.getContextMenu = function() { return document.getElementById("contentAreaContextMenu"); };
this.getTabContainer = function() { return gBrowser.tabContainer; };

The very last change required in order for the extension to be accepted for installation is the removal of the entire META-INF folder from the package. That one only contains verification elements for authenticity purpose, which would obviously fail once we modified those files, so we get rid of it completely.

Now all modified files along with the remaining original ones can be repacked in a new zip file which will then have its extension changed to xpi like the original. Installation should be performed as usual, by opening the Add-ons page from menu > Tools > Add-ons and choosing Install from file, or much simpler by drag’n drop of the xpi file onto the browser window.

Good luck! thumbs up