Roman Yakoviv
Roman Yakoviv

Reputation: 1724

How to get the link to the latest version of firefox addon?

I don't want to redirect user to firefox's store to install addon. I want to user be able to install addon immediately on my own site. I know for this I should create 'a' element with href to .xpi file. But how I can get the link to the latest version of .xpi file of the addon from the firefox store?

Upvotes: 3

Views: 1268

Answers (3)

avijit
avijit

Reputation: 911

Found this page while googling the error of Firefox saying it can not find the latest URL for an extension. So the problem is Firefox extension URL has weird behaviour based on individual extension URL or latest. The add-on name for individual URL will contain _ between words and in the latest URL the add-on name will contain - between words.

https://addons.mozilla.org/firefox/downloads/file/1234567/my_extension-1.1.0.xpi

https://addons.mozilla.org/firefox/downloads/latest/my-extension/latest.xpi

https://addons.mozilla.org/firefox/downloads/latest/my_extension/latest.xpi # this will not work

Upvotes: 0

P. B.
P. B.

Reputation: 687

According to the Firefox Policy Templates, it should be possible to simply use https://addons.mozilla.org/firefox/downloads/latest/SHORT_NAME/latest.xpi, where SHORT_NAME corresponds to the add-on name. It does not seem to be necessary to extract the user ID (anymore?):

E.g., https://addons.mozilla.org/firefox/downloads/latest/givero/latest.xpi for givero.

Upvotes: 2

Roman Yakoviv
Roman Yakoviv

Reputation: 1724

I've got it. The formula to get always the latest version of xpi file of addon:

addons.mozilla.org/firefox/downloads/latest/ADDON_NAME/addon-ADDON_ACCOUNT_ID-latest.xpi

Upvotes: 4

Related Questions