How to troubleshoot Firefox Addon: could not be installed because it is not compatible with Firefox <x.x.x.x> - firefox

I created a simple extension based on an existing one, but when I try to test it and add to Firefox manually I get this general error message:
<Extension Name> could not be installed because it is not compatible with Firefox <x.x.x.x>
How can I troubleshoot this?
I even tried setting maxVersion to a high value in install.rdf.
<em:maxVersion>150</em:maxVersion>

If you have verified that you have the correct minVersion and maxVersion, the other thing that can cause this is an invalid updateURL.
The Firefox bug about this is https://bugzilla.mozilla.org/show_bug.cgi?id=740378
If you are planning to host your add-on on addons.mozilla.org, you do not need an updateURL and if you are in the process of developing an add-on, there should be no updateURL in your install.rdf at all.

If minVersion and maxVersion are correct but your extension still doesn't install then these values are probably overridden. In addition to the values in install.rdf Firefox will also look up the update URL of your extension and get updated compatibility information from there. This information takes priority over whatever you specify in install.rdf.
If you specify an updateURL explicitly then you should update the information in the file it points to and clear the browser cache. If you don't specify an updateURL then by default it points to addons.mozilla.org. If an extension with the same ID and version number is found on addons.mozilla.org then its compatibility information is taken over. If that's the case then changing the version number in install.rdf to something unknown to addons.mozilla.org should be sufficient (obviously, you should also change extension ID of the extension hosted on addons.mozilla.org isn't yours).
Plus there is the bug mentioned by Mike Kaply of course - bad error message if an insecure updateURL is specified and no updateKey.

Your max version should look something like:
<em:maxVersion>17.*</em:maxVersion>
That indicates the max version of Firefox that supports the extension. Firefox 150 is a long way off! ;-)
Do you have the source code posted anywhere? I'd be glad to take a look. I've written a couple of Firefox extensions now, so I'm sure I can help.

First, check https://support.mozilla.org/en-US/kb/unable-install-add-ons-extensions-or-themes to see if any of those reasons apply.
With the release of Firefox 57 (14 Nov 2017), developers can no longer build "legacy" add-on .xpi files locally and load them in Firefox, only add-ons built using the webextensions API will load.
Hope this helps :)

Related

Module type default in Firefox

I'm not sure if this is the right place to ask this. I've googled this and not really finding the results. I'm using ES6 modules and import/export and load my initial javascript using module type
<script type="module" src="/app.js"></script>
In Chrome its on by default. In firefox you have to enable it in about:config
The problem is I cant have users manually enabling this flag for it to work. Is there a future where this will be on by default in Firefox? At CanIUse, it says that in version 60, its on by default. But every version of Firefox I've downloaded is only version 59.00 (Windows). I would like to avoid babel if possible.
Is there a future where this will be on by default in Firefox?
Yes.
At CanIUse, it says that in version 60, its on by default. But every version of Firefox I've downloaded is only version 59.00 (Windows).
You can download the nightly build here.
I would like to avoid Babel if possible.
Well you cannot avoid if you want to support older browsers that do not (yet) support this feature.

Trouble Packaging Firefox Extension

I have followed a couple different links that show how to package Firefox extensions. In cfx, my extension runs exactly how I want it. I made my install.rdf and zipped my files, changing the file type to xpi. When I install it in live Firefox, it shows up in my installed extensions, but nothing happens. I have also tried just using the base install.rdf that they post as a sample, but no luck. What am I missing here?
Here's one guide I've been working off of.
You should be using cfx xpi to package your addons, not the docs you pointed to. As #Noitidart pointed out, there are reasons to unpackage that xpi file and repackage it, and that is mentioned in the above link.
There are three ways to make extensions for Firefox. When you're using the add-on SDK (one of the ways), make sure all the docs you're reading are under the developer.mozilla.org/en-US/Add-ons/SDK/ path.
Note that Firefox is making the move from cfx to jpm, so unless you need your extensions to be available on AMO very soon, you should use jpm.

Unable to run firefox extension

I'm new to Firefox extension development, friendly speaking it's first day, I had followed the following article in order to start with Firefox extension development: How to develop a Firefox extension.
If I download the example from above given link's tutorial and try to install, it is installed perfectly but, when I update that example (just updating its name to the new extension name, where it is necessary in all files), and then install, I get the following message: "X could not be installed because it is not compatible with Firefox 15.0.1." (where X is the name of my extension).
Strange behavior same code one is installing fine and other one giving error.
Any idea where it is going wrong and what is causing this?
The problem is that you forgot to adjust the compatibility range in install.rdf so em:maxVersion is still saying 3.1b2 (meaning Firefox 3.1b2 - a rather old version). You should change that into 15.* if you want to support the current stable Firefox version or 16.* if you want to support the current beta versions. You can also change em:minVersion into something more meaningful: I doubt that you will verify whether your extension still works with Firefox 2.0.
As to why the extension installs if you don't change the extension ID, this is more complicated. First of all, there is a soft override mechanism for the compatibility ranges which allows extension authors to change the compatible version range without releasing a new version. In this particular case Firefox will check for extension updates by requesting this address or a similar one. The update server tells it that version 1.0 is still current but adjusts maxVersion to Firefox 8.0 - this value will override whatever is specified in install.rdf.
But that's not the end of the story. The compatibility check mechanism was changed significantly in Firefox 10, the default assumption is now that the add-on is compatible with newer versions even if that isn't specified explicitly anywhere. The requirements are that the extension doesn't opt out of lax compatibility checking, doesn't contain binary components and is compatible with at least Firefox 4. The original extension is compatible with Firefox 8 thanks to the soft override, with a different extension ID it is only compatible with Firefox 3.1b2 however (it isn't hosted on addons.mozilla.org so the update server doesn't know about it) which means that the lax compatibility checking doesn't apply to it.
For reference: the behavior described in the previous paragraph is controlled by the extensions.strictCompatibility, extensions.minCompatibleAppVersion and extensions.minCompatiblePlatformVersion preferences.

Add-on support after update

In a previous project I wrote a Firefox extensions - nothing too complex - that used xmpp4moz, an add-on for Firefox that integrates the xmpp/Jabber protocol. At that time Firefox 3.6 most the most recent one and everything worked quite well. Now with Firefox 5 xmpp4moz does produces errors, starting with
Error: Component.classes['#something/something/...'] is undefined
and naturally resulting in further 'undefined' errors. In some sense this is ok, since xmpp4moz is officially not available for Firefox 5. And given that the last update was in 2009 I don't really expect a updated version. Currently I see the following two options:
Looking for alternatives/workarounds/...; so far I haven't found anything. Any ideas?
Trying to update/modify xmpp4moz myself to make it running in Firefox 5
The thing is that at the moment I cannot really assess the required efforts.
Summing up, I'm stuck :)
The sameplace download at http://www.sameplace.cc/ appears to include a slightly newer version of xmpp4moz (I didn't really check whether install.rdf is the only difference from the source code repository however). Still, it is only compatible with Firefox 3.6. From the look of it, there are no big issues, main problem is that the XPCOM components aren't being registered. See https://developer.mozilla.org/en/XPCOM/XPCOM_changes_in_Gecko_2.0 for information on the relevant changes, usually updating the components and chrome.manifest is easy.

Installing web developer plugin for Firefox 3.6 from corp. network

I'm trying to install the web developer plugin, and it's failing with a message that "Web Developer 1.1.8 could not be installed because it is not compatible with Firefox 3.6.13".
I don't believe that it's actually incompatible; rather I think the problem is because the installation fails during a validation check, probably because the corp. network is messing with the connections. The message I get is that:
services.addons.mozilla.org uses an invalid security certificate
and when I view the certificate, it's issued by the networking group, not mozilla.
Is there a way to by-pass the version check so I can install it?
The most likely explanation is that the XPI you were trying to install had em:maxVersion in its install.rdf smaller than the Firefox version, so Firefox was checking with addons.mozilla.org to see if the version you were trying to install was marked as compatible (addons.mozilla.org allows to bump the maxVersion, but doesn't update the XPI it serves to the users).
If for any reason that update check failed, Firefox wouldn't let you install the extension.
The solution in that case (extension version actually compatible with Firefox, but has stale information in its install.rdf) would be to edit the XPI to bump maxVersion manually before attempting to install the XPI.
That's weird that it's giving you the "not compatible with Firefox version x" message since, as you say, that doesn't seem to be the actual problem. See if this works: Right-click on the installer link and select "Save Link As..." and save the file on your hard drive. It will be called something like webdeveloper.xpi. Then just drag and drop the file onto Firefox.

Resources