0

I'm developing a desktop application that can integrate with some Mozilla application¹ through an add-on. I'd like to provide users the option to install the add-on through my application, but I haven't been able to find an official way fulfilling my requirements:

  1. The add-on, once installed, must receive automatic updates
  2. There should be no complex user interaction required
  3. The method must not be forbidden by Mozilla (as in, must not result in blacklisting)

Is there a method to install an add-on fulfilling these requirements?


Options I considered, that do not fulfill these requirements:

  • Global installation of add-ons – this does, however, not permit automatic updates through AMO's infrastructure or updateURLs in install.rdf (violates 1)
  • Copying the XPI into the default profile and enabling it – does not cause the Opt-in dialog to show up, which is a violation of the Add-on Guidelines and thus a ticket to blacklisting² (violates 3)
  • Executing the application with the URL of the XPI – does only work for applications with a browser component, such as Firefox, but not for Thunderbird

I run into some profile-related bugs while testing, this option is better than my initial tests suggested:

  • Copying the XPI into the default profile – results in the add-on starting in disabled state, thus not being any better than telling the user to download the extension manually (violates 2) and the user will be asked to permit (or decline) the installation in a new tab (sadly, this tab is sometimes opened in the background, thus not optimal for condition 2)

¹ In my case, that is Thunderbird; but I'd like to keep the question open for Firefox as well, if possible.

² I do not think the issue could be resolved by using a custom opt-in dialog within my application, as Mozilla is known to blindly enforce policies for the Mozilla-defined "greater good" (see add-on signing).

dst
  • 3,307
  • 1
  • 20
  • 27
  • If you bundle the addon with a system install then you can just update the whole system install, no? – the8472 Jul 20 '16 at 10:41
  • Most antivirus installers does what you need (only they put addons to Firefox, but not TB). Look to the addons from Kaspersky or AVG. – M.Onyshchuk Jul 20 '16 at 14:07
  • @Makyen your first link points to meta, but [I found the question you're referring to](http://stackoverflow.com/questions/37682010/how-to-have-firefox-auto-update-extensions-bundled-with-an-application), thanks! – dst Jul 20 '16 at 14:19
  • @the8472 the application installing the add-on has its own update cycles, I don't want to be forced to issue a new version of the desktop application on updates of the add-on. – dst Jul 20 '16 at 14:20
  • @dst, Sorry about the wrong link target. It was one of the few times I did not double check the link target. That one was left over from a comment on a different question. – Makyen Jul 20 '16 at 14:35
  • Near duplicate: [How to have Firefox auto-update extensions bundled with an application](http://stackoverflow.com/q/37682010/3773011). Related (discusses multiple installation methods): [Install WebExtensions on Firefox from the command line](http://stackoverflow.com/a/37739112/3773011). Note: This comment is a corrected version of one I left 13 hours ago with the first link target wrong. As having the wrong link is counterproductive, I deleted my original comment. – Makyen Jul 20 '16 at 14:47

1 Answers1

0

While not an optimal solution, additional testing suggests the one of the initial approaches mentioned in the question works better than my initial tests suggested:

Copy the XPI into the extension folder of all profiles that shall be affected, using the filename ID.xpi where ID is the id of the add-on (if the add-on requires unpacking, unpack it into a ID folder instead).

This will install the add-on in a disabled state, but the user will be asked on the next application start whether he/she wishes to permit the installation. Upon user confirmation, the add-on will be enabled.


I'd welcome additional answers addressing the issues of this solution:

  • The tab asking for user confirmation is shown in the background in some cases (for example in Thunderbird if the add-on tab was the foreground tab when closing before the restart)
  • The installer thus needs logic to parse profiles.ini in order to determine profile folder locations
  • Only profiles at install time may be affected
dst
  • 3,307
  • 1
  • 20
  • 27