0

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;
Atefeh Rashidi
  • 485
  • 1
  • 8
  • 32
  • Please [edit] your question to be on-topic: Questions seeking debugging help ("**why isn't this code working?**") must include: ►the desired behavior, ►a specific problem or error *and* ►the shortest code necessary to reproduce it **in the question itself**. Questions without a clear problem statement are not useful to other readers. See: [**How to create a Minimal, Complete, and Verifiable Example**](http://stackoverflow.com/help/mcve), [What topics can I ask about here?](http://stackoverflow.com/help/on-topic), and [How do I ask a good question?](http://stackoverflow.com/help/how-to-ask). – Makyen Nov 21 '16 at 09:01
  • Without code it is not possible for us to make any guess as to why this add-on does not work. Just providing a pointer to your add-on is not sufficient wrt. providing code. It must be *in the question itself*. – Makyen Nov 21 '16 at 09:07
  • Another time, when you are writing your add-on, it is a good idea to test with Firefox versions which are in the pipeline for release. This includes [Firefox Beta](https://www.mozilla.org/en-US/firefox/channel/desktop/), [Firefox Developer Edition](https://www.mozilla.org/en-US/firefox/developer/), and [Firefox Nightly](https://nightly.mozilla.org/). Your add-on was release on 2016-10-23. Nightly was either ver. 51 or 52 at that time. Doing such testing will reduce the number of times when your add-on needs to be updated, and/or times when your add-on stops working for your users. – Makyen Nov 21 '16 at 09:27
  • What, *exactly*, was shown in the [Browser Console](https://developer.mozilla.org/en-US/docs/Tools/Browser_Console) (Ctrl-Shift-J, or Cmd-Shift-J on OSX) with respect to your add-on when you started Firefox with it installed (Given that it is not a restartless add-on it is not possible to see startup information separate from Firefox startup)? – Makyen Nov 21 '16 at 09:30
  • Thanks. Just my website users can use this add-on and when they click on add-on they can download PDF and articles.@Makyen – Atefeh Rashidi Nov 21 '16 at 10:50

1 Answers1

1

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:

Makyen
  • 31,849
  • 12
  • 86
  • 121