是否有获取最新Microsoft Edge版本号的链接



我正在寻找一个链接,以获取Microsoft Edge的最新驱动程序版本号,类似于Google Chrome的链接:https://chromedriver.storage.googleapis.com/LATEST_RELEASE

我有一个函数来返回版本号的字符串。然后,我可以创建这样的下载链接:

private String getLatestChromeDriverVersion(){
RestTemplate restTemplate = new RestTemplate();
String url = "https://chromedriver.storage.googleapis.com/LATEST_RELEASE";
return restTemplate.getForObject(url, String.class);
}
String chromeDownloadUrl = "https://chromedriver.storage.googleapis.com/" + getLatestChromeDriverVersion() + "/chromedriver_win32.zip";

我一直在为Edge寻找类似的东西,但找不到任何东西。他们有下载驱动程序的页面:https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/但没有像/最新的或/稳定的。

有什么想法吗?

您可以通过以下两个链接获得官方文档中给出的最新版本号:

https://msedgedriver.azureedge.net/LATEST_STABLE

https://msedgewebdriverstorage.blob.core.windows.net/edgewebdriver/LATEST_STABLE

注意:它们都返回一个文件,而不是像chrome那样直接返回版本号,您需要从该文件中获取版本号。

一个简单的演示:

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://msedgedriver.azureedge.net/LATEST_STABLE"))
.build();

HttpResponse<String> response  = client.send(request, BodyHandlers.ofString());

String version = response.body().replaceAll("[^\d|.]", "");
System.out.println(version);

您可以获得作为JSON的最新Edge版本。每个平台和拱门都有按渠道(产品(划分的最新版本。

消费者构建:(Windows、MacOS、Linux、Android、IOS(

https://edgeupdates.microsoft.com/api/products

企业版:(Windows,MacOS,Linux,GPO策略文件(

https://edgeupdates.microsoft.com/api/products?view=enterprise

构建分为通道(稳定、测试、开发、Canary(

示例:

{
"Product": "Dev",
"Releases": [
{
"ReleaseId": 43248,
"Platform": "MacOS",
"Architecture": "universal",
"CVEs": [],
"ProductVersion": "110.0.1587.2",
"Artifacts": [
{
"ArtifactName": "pkg",
"Location": "https://officecdnmac.microsoft.com/pr/03adf619-38c6-4249-95ff-4a01c0ffc962/MacAutoupdate/MicrosoftEdgeDev-110.0.1587.2.pkg",
"Hash": "046BB1322257530A66BCCEC6E821F2548163BEC1818C85B6FEB1E986DB62EBC0",
"HashAlgorithm": "SHA256",
"SizeInBytes": 352551023
},
{
"ArtifactName": "plist",
"Location": "https://officecdnmac.microsoft.com/pr/03adf619-38c6-4249-95ff-4a01c0ffc962/MacAutoupdate/MicrosoftEdgeDev-110.0.1587.2.plist",
"Hash": "4C8EB411D4A93FB721FF7A90031C95D696E97BB2D9051C48501C0BEB12AFBB19",
"HashAlgorithm": "SHA256",
"SizeInBytes": 3053
}
],
"PublishedTime": "2023-01-05T19:43:00",
"ExpectedExpiryDate": "2023-04-05T19:43:00"
},
{
"ReleaseId": 43170,
"Platform": "Windows",
"Architecture": "x64",
"CVEs": [],
"ProductVersion": "110.0.1587.1",
"Artifacts": [
{
"ArtifactName": "msi",
"Location": "https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/4de84b50-b3a8-4751-afb8-73812bce8713/MicrosoftEdgeDevEnterpriseX64.msi",
"Hash": "4DC76967D9BA3BFDB275B8D40AE3A9ED7F77C661879BFC1CD6C4264EBDC09540",
"HashAlgorithm": "SHA256",
"SizeInBytes": 147148800
}
],
"PublishedTime": "2023-01-04T20:22:00",
"ExpectedExpiryDate": "2023-04-04T20:22:00"
}
]
}
}

彭旭东的回答是正确的。我只想补充一点,你可以通过这个链接获得某个主要版本的最新版本:

https://msedgewebdriverstorage.blob.core.windows.net/edgewebdriver/LATEST_RELEASE_<MAJOR_VERSION>

再次,它将返回一个文件,您需要解析该文件才能获得最新版本。

如果像我的情况一样,你的Edge浏览器不是最新版本,并且你想检索该版本的最新边缘驱动程序,这是有用的。

最新更新