HiveBrain v1.2.0
Get Started
← Back to all entries
snippetMinor

How to get the latest stable version of Firefox?

Submitted by: @import:stackexchange-devops··
0
Viewed 0 times
latesttheversionstablegethowfirefox

Problem

How to get the latest version of firefox? This URL was found, but is there no API? I would like to get the latest version, e.g. 58.0.2 so this could be used for other purposes. Just latest is insufficient as I require the version in one of my ansible roles to lookup the checksum.

At the moment I am considering to parse https://www.mozilla.org/en-US/firefox/releases/

Solution

You do not want to be parsing HTML in a programmatic way. Avoid it at all costs, if you can. It would be a nightmare to support on-going. There's actually a JSON output that Mozilla provides of all the versions:

https://product-details.mozilla.org/1.0/firefox_versions.json

Edit: Here is a simple bash script example that will always return the latest Firefox version. Make sure you have jq & curl installed on your system:

curl -s https://product-details.mozilla.org/1.0/firefox_versions.json | jq -r .LATEST_FIREFOX_VERSION


This returns:

58.0.2

Code Snippets

curl -s https://product-details.mozilla.org/1.0/firefox_versions.json | jq -r .LATEST_FIREFOX_VERSION

Context

StackExchange DevOps Q#3375, answer score: 3

Revisions (0)

No revisions yet.