From 81e33735dae8aa94efd57c52ef7af6b7f6cc30cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dar=C3=ADo=20Kondratiuk?= Date: Fri, 17 Jan 2025 09:38:56 -0500 Subject: [PATCH 1/3] Roll chrome to 132 --- lib/PuppeteerSharp/BrowserData/Chrome.cs | 2 +- lib/PuppeteerSharp/PuppeteerSharp.csproj | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/PuppeteerSharp/BrowserData/Chrome.cs b/lib/PuppeteerSharp/BrowserData/Chrome.cs index ae0753bfd..fcc219223 100644 --- a/lib/PuppeteerSharp/BrowserData/Chrome.cs +++ b/lib/PuppeteerSharp/BrowserData/Chrome.cs @@ -13,7 +13,7 @@ public static class Chrome /// /// Default chrome build. /// - public static string DefaultBuildId => "130.0.6723.69"; + public static string DefaultBuildId => "132.0.6834.83"; internal static async Task ResolveBuildIdAsync(ChromeReleaseChannel channel) => (await GetLastKnownGoodReleaseForChannel(channel).ConfigureAwait(false)).Version; diff --git a/lib/PuppeteerSharp/PuppeteerSharp.csproj b/lib/PuppeteerSharp/PuppeteerSharp.csproj index 85f55f1ff..3d02d02a4 100644 --- a/lib/PuppeteerSharp/PuppeteerSharp.csproj +++ b/lib/PuppeteerSharp/PuppeteerSharp.csproj @@ -12,10 +12,10 @@ Headless Browser .NET API PuppeteerSharp - 20.0.5 - 20.0.5 - 20.0.5 - 20.0.5 + 20.1.0 + 20.1.0 + 20.1.0 + 20.1.0 false false embedded From a94a5f734db2534935be79a2ad58e34133070d9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dar=C3=ADo=20Kondratiuk?= Date: Fri, 17 Jan 2025 10:22:10 -0500 Subject: [PATCH 2/3] Fix firefox download --- lib/PuppeteerSharp/BrowserData/Firefox.cs | 9 ++++++++- lib/PuppeteerSharp/BrowserFetcher.cs | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/PuppeteerSharp/BrowserData/Firefox.cs b/lib/PuppeteerSharp/BrowserData/Firefox.cs index 94681a862..390b7adb5 100644 --- a/lib/PuppeteerSharp/BrowserData/Firefox.cs +++ b/lib/PuppeteerSharp/BrowserData/Firefox.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Globalization; using System.IO; using System.Linq; using System.Text.Json; @@ -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 { diff --git a/lib/PuppeteerSharp/BrowserFetcher.cs b/lib/PuppeteerSharp/BrowserFetcher.cs index f70f6d9f4..a9a6ecf44 100644 --- a/lib/PuppeteerSharp/BrowserFetcher.cs +++ b/lib/PuppeteerSharp/BrowserFetcher.cs @@ -433,7 +433,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); } From 8d8973da59f5fe6ea65e656b285c1ae4ba51cb60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dar=C3=ADo=20Kondratiuk?= Date: Mon, 3 Feb 2025 09:08:30 -0300 Subject: [PATCH 3/3] Fix xz process --- lib/PuppeteerSharp/BrowserFetcher.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/PuppeteerSharp/BrowserFetcher.cs b/lib/PuppeteerSharp/BrowserFetcher.cs index a9a6ecf44..0b9059da8 100644 --- a/lib/PuppeteerSharp/BrowserFetcher.cs +++ b/lib/PuppeteerSharp/BrowserFetcher.cs @@ -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();