snippetMinor
How to get the latest stable version of Firefox?
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.
At the moment I am considering to parse https://www.mozilla.org/en-US/firefox/releases/
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
This returns:
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_VERSIONThis returns:
58.0.2Code Snippets
curl -s https://product-details.mozilla.org/1.0/firefox_versions.json | jq -r .LATEST_FIREFOX_VERSIONContext
StackExchange DevOps Q#3375, answer score: 3
Revisions (0)
No revisions yet.