Why does my Firefox add-on not work after updating Firefox to version 50

95 Views Asked by At

I developed an add-on, daneshLink, which was verified by Firefox. Users installed this add-on and used it. This add-on worked, but when Firefox updated to version 50.0, this add-on doesn't work.

(Note: Add-on was not removed or disabled after updating Firefox. It just doesn't work at all).

var x = content.document.getElementsByTagName('html')[0].innerHTML;
var test = x.match(/>article Id:[0-9a-zA-z]/img);
var url = "> <a href=\"http://mysite.ir/index.jsp?articleID=";
for (var i = 0; i < test.length; i++) {
    x = x.replace(test[i], url +">Download :" + test[i] + "</a>");
}
 content.document.getElementsByTagName('html')[0].innerHTML = x;
1

There are 1 best solutions below

0
On BEST ANSWER

The code you have provided is insufficient to know what the problem is, but I can guess. You are most likely encountering an issue with moving to multiprocess Firefox. The fact that this is an Overlay add-on and your use of content.document makes it likely you are not separating accessing the DOM of web pages (using workers) from your main script.

You are probably best served by re-writing this as a WebExtension, if possible. Alternately, you can write it as an Add-on SDK based extension. If you really need to have it be an Overlay add-on, it is possible to provide the separation between your main script functionality and accessing the DOM. However, it is just not as convenient to do so as it is for other types of add-ons.

You may be able to have the current code be compatible for somewhat longer by specifying:

<em:multiprocessCompatible>false/em:multiprocessCompatible>

in your install.rdf. Doing so should prevent Firefox from enabling multiprocess mode when your extension is installed, or, at least, use the compatibility shims which may be sufficient for your add-on to function.

I would suggest you read: