14

I am trying to work out how to best implement direct installation from my website. Besides simply prompting the user to install the addon, I would also want to get the result of the user action (accepts installation or cancels it).

Research on google generally points to the use of InstallTrigger.install(), which works fine except that there is no functional callback that I can use to know the result of the user's action.

Though InstallTrigger.install() does accept a callback, the callback is not fired unless the current viewing page is a whitelisted domain (e.g. AMO):

https://developer.mozilla.org/en-US/docs/Archive/Mozilla/XPInstall/Reference/InstallTrigger_Object/Methods/install

So I am wondering:

  1. Is there any alternative way to get the result of the addon installation, and
  2. Does have anyway to accept a domain into their default addon installation whitelist.

Thanks a lot!

Farside
  • 9,923
  • 4
  • 47
  • 60
Bear of the Year
  • 333
  • 1
  • 2
  • 8
  • Did you find a solution for this? – Ivan Carosati Aug 19 '15 at 20:09
  • 4
    There is no solution. Only AMO is whitelisted. – Bear of the Year Aug 21 '15 at 00:01
  • 3
    A possible solution would be to make your addon send a ping to your server when it is installed. This way you indirectly know when a user accepts to install it. – Marco Castelluccio Feb 25 '16 at 12:41
  • @Marco, someone what half acceptable answer, you would know if they installed it but not rejected... Anyway another approach could be to send a postMessage to all/some window/tabs so you wouldn't need a server – Endless May 16 '16 at 17:24
  • sorry i cant comment yet so does this answer your question http://stackoverflow.com/questions/4636407/how-do-i-check-in-firefox-and-chrome-if-a-plugin-is-installed – RamenScript Aug 18 '16 at 14:01

1 Answers1

1

Just to get this question off the Unanswered list.

The XPInstall whitelist only contains Mozilla's sites, so Mozilla doesn't seem to have a way to accept a domain into their default addon installation whitelist.

The browser itself will not notify the untrusted web page about the results of the add-on installation. If your extension is restartless, it can notify the page it has been installed via postMessage.

Nickolay
  • 31,095
  • 13
  • 107
  • 185