Firefox displays outdated information from MDN on newly self-hosted extension
I’m trying to switch the Firefox extension I’m developing from being hosted on MDN/mozilla.org to being self-hosted. This involves adding an entry to install.rdf pointing to an update.rdf on my own server.
However, I am finding that if a given Firefox profile has ever had the older, hosted-on-MDN version installed in it, it will then continue to look up information from MDN instead of just using the information contained in the extension’s install.rdf. This means that the information on the extension displayed in about:addons stays out of date.
Here is a detailed walkthrough:
- Create a new Firefox profile.
- Manually install newest version of the Firefox extension by dropping it into extensions/ and then confirming the install. This extension is self-hosted: it has a updateURL set in its install.rdf.
- Go to about:addons and confirm that the information displayed about the plugin is the information from the extension’s install.rdf. (Description, creator, etc.)
- Uninstall the extension.
- Install the old non-self-hosted version of the extension from MDN, via the add-ons manager interface.
- Go to about:addons and confirm that the information displayed about the extension is information sourced from MDN. (Description, creator, etc.) Search all files that comprise this version of the extension to make sure that the information displayed is definitely not contained within it, and hence is sourced from MDN.
- Uninstall this version of the extension.
- Again install the new, self-hosted version of the extension by dropping it into extensions/ and confirming the install with Firefox.
- Go to about:addons. Observe that the displayed information is still sourced from MDN, despite this being the self-hosted version. Specifically, the creator and description are sourced from MDN, while the icon is sourced from install.rdf.
Firefox appears to be caching information about the extension even when the extension has been uninstalled, and once a given extension has been seen to be hosted on MDN, it will continue getting information from MDN even if the extension is now self-hosted.
Is there some step of this I’m missing beyond setting a updateURL value in the extension’s install.rdf? Is this a bug in Firefox? Is there a workaround?
By default, Firefox grabs information from AMO for your add-on and it overwrites the information in the install.rdf.
So if you’ve moved your add-on from AMO to self hosting, the information will still be retrieved.
To prevent that, you can set a preference:
pref(“extensions.YOUR_ADDON_ID.getAddons.cache.enabled”, false);
This will keep Firefox from getting info about your add-on from AMO.
It might not take effect immediately for you, but it should take effect within 24 hours.