获取Chrome浏览器的最新发行版本号 [英] Get latest release version number for chrome browser

查看:307
本文介绍了获取Chrome浏览器的最新发行版本号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试找到一种相当稳定的方法,以编程方式确定chrome浏览器的最新发行版本号.

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".

  • 似乎没有API(有吗?).
  • 我不想依靠第三方手动处理这些东西.
  • 我不想解析任何网站输出.

所以我最终获取了git文件.

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

哪个给出了最新的版本号.
从那里开始,解决方案就只有一个preg_match_all ... 不幸的是,它不是最新的发行版,而是最新的开发版.

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!

推荐答案

Chrome小组使用 OmahaProxy 仪表板跟踪稳定版本/beta/dev/canary中的当前版本.如果您可以抓取,则可以获取所需的任何版本号.

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.

这篇关于获取Chrome浏览器的最新发行版本号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆