Skip to content

Commit

Permalink
Roll chrome to 132 (#2871)
Browse files Browse the repository at this point in the history
* Roll chrome to 132

* Fix firefox download

* Fix xz process
  • Loading branch information
kblok authored Feb 4, 2025
1 parent 1459dbe commit d20a46e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/PuppeteerSharp/BrowserData/Chrome.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public static class Chrome
/// <summary>
/// Default chrome build.
/// </summary>
public static string DefaultBuildId => "130.0.6723.69";
public static string DefaultBuildId => "132.0.6834.83";

internal static async Task<string> ResolveBuildIdAsync(ChromeReleaseChannel channel)
=> (await GetLastKnownGoodReleaseForChannel(channel).ConfigureAwait(false)).Version;
Expand Down
9 changes: 8 additions & 1 deletion lib/PuppeteerSharp/BrowserData/Firefox.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text.Json;
Expand Down Expand Up @@ -181,12 +182,18 @@ private static string GetFirefoxPlatform(Platform platform)
private static string GetArchiveNightly(Platform platform, string buildId)
=> platform switch
{
Platform.Linux => $"firefox-{buildId}.en-US.{GetFirefoxPlatform(platform)}-x86_64.tar.bz2",
Platform.Linux => $"firefox-{buildId}.en-US.{GetFirefoxPlatform(platform)}-x86_64.tar.{GetFormat(buildId)}",
Platform.MacOS or Platform.MacOSArm64 => $"firefox-{buildId}.en-US.mac.dmg",
Platform.Win32 or Platform.Win64 => $"firefox-{buildId}.en-US.{GetFirefoxPlatform(platform)}.zip",
_ => throw new PuppeteerException($"Unknown platform: {platform}"),
};

private static string GetFormat(string buildId)
{
var majorVersion = int.Parse(buildId.Split('.')[0], CultureInfo.CurrentCulture);
return majorVersion >= 135 ? "xz" : "bz2";
}

private static string GetArchive(Platform platform, string buildId)
=> platform switch
{
Expand Down
5 changes: 3 additions & 2 deletions lib/PuppeteerSharp/BrowserFetcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,11 @@ internal static string GetBrowsersLocation()

private static void ExtractTar(string zipPath, string folderPath)
{
var compression = zipPath.EndsWith("xz", StringComparison.InvariantCulture) ? "J" : "j";
new DirectoryInfo(folderPath).Create();
using var process = new Process();
process.StartInfo.FileName = "tar";
process.StartInfo.Arguments = $"-xvjf \"{zipPath}\" -C \"{folderPath}\"";
process.StartInfo.Arguments = $"-xv{compression}f \"{zipPath}\" -C \"{folderPath}\"";
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.UseShellExecute = false;
process.Start();
Expand Down Expand Up @@ -433,7 +434,7 @@ private async Task UnpackArchiveAsync(string archivePath, string outputPath, str
{
ExecuteSetup(archivePath, outputPath);
}
else if (archivePath.EndsWith(".tar.bz2", StringComparison.OrdinalIgnoreCase))
else if (archivePath.Contains(".tar."))
{
ExtractTar(archivePath, outputPath);
}
Expand Down
8 changes: 4 additions & 4 deletions lib/PuppeteerSharp/PuppeteerSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
<Description>Headless Browser .NET API</Description>
<PackageId>PuppeteerSharp</PackageId>
<PackageReleaseNotes></PackageReleaseNotes>
<PackageVersion>20.0.5</PackageVersion>
<ReleaseVersion>20.0.5</ReleaseVersion>
<AssemblyVersion>20.0.5</AssemblyVersion>
<FileVersion>20.0.5</FileVersion>
<PackageVersion>20.1.0</PackageVersion>
<ReleaseVersion>20.1.0</ReleaseVersion>
<AssemblyVersion>20.1.0</AssemblyVersion>
<FileVersion>20.1.0</FileVersion>
<SynchReleaseVersion>false</SynchReleaseVersion>
<StyleCopTreatErrorsAsWarnings>false</StyleCopTreatErrorsAsWarnings>
<DebugType>embedded</DebugType>
Expand Down

0 comments on commit d20a46e

Please sign in to comment.