Get latest release version number for chrome brows

2020-06-17 04:26发布

问题:

I am trying to figure out a rather stable way to programmatically determine the latest release version number of the chrome browser.

It doesn't have to be failproof as it's only a nice-to-have-feature I can blend out whenever the result looks "suspicious".

  • There seems to be no API (is there?).
  • I dont want to rely on third parties handling that stuff manually.
  • I dont want to parse any website output.

So I ended up fetching git files.

My first approach was to fetch this file:

https://chromium.googlesource.com/chromium/src.git/+/master/chrome/VERSION?format=TEXT

Which gives the latest version number.
From there on the solution is just a preg_match_all away ... Unfortunately its not the latest release version but the latest dev version.

There seems to be no "release" branch nor a "release" tag or something else I can think of neither.

You might answer "why?"... I know about feature detection, I know browser sniffing can be fooled and I am aware of the fact that (every) browser will notify their users when it's time to update. Still makes sense in my case. On the other hand its solely for display purposes. Nothing is going to depend on it later on – promise :-)

Any – even the faintest – ideas are highly appreciated!

回答1:

The Chrome team uses the OmahaProxy dashboard to keep track of current versions in stable/beta/dev/canary. If you can scrape that you can get whatever version number you're looking for.



回答2:

Feel free to use my online service vergrabber to get latest versions of different kind of software in json format. It's available at http://vergrabber.kingu.pl/vergrabber.json



回答3:

If you're on debian based linux, you could install and update your chrome once a day, and somehow parse the version number, but this is not realtime.

For example:

wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
dpkg -i google-chrome-stable_current_amd64.deb

Which will give a log like this:

(Reading database ... 113338 files and directories currently installed.)
Preparing to unpack google-chrome-stable_current_amd64.deb ...
Unpacking google-chrome-stable (48.0.2564.97-1) over (47.0.2526.111-1) ...
Setting up google-chrome-stable (48.0.2564.97-1) ...
Processing triggers for menu (2.1.47) ...

Then just parse it.