diff --git a/lib/PuppeteerSharp/BrowserData/Chrome.cs b/lib/PuppeteerSharp/BrowserData/Chrome.cs
index 2aeb46519..fb45645d6 100644
--- a/lib/PuppeteerSharp/BrowserData/Chrome.cs
+++ b/lib/PuppeteerSharp/BrowserData/Chrome.cs
@@ -30,7 +30,7 @@ internal static string RelativeExecutablePath(Platform platform, string builId)
"Contents",
"MacOS",
"Google Chrome for Testing"),
- Platform.Linux => Path.Combine("chrome-linux64", "chrome"),
+ Platform.Linux or Platform.LinuxArm64 => Path.Combine("chrome-linux64", "chrome"),
Platform.Win32 or Platform.Win64 => Path.Combine("chrome-" + GetFolder(platform), "chrome.exe"),
_ => throw new ArgumentException("Invalid platform", nameof(platform)),
};
@@ -60,6 +60,7 @@ internal static string ResolveSystemExecutablePath(Platform platform, ChromeRele
ChromeReleaseChannel.Dev => $"/Applications/Google Chrome Dev.app/Contents/MacOS/Google Chrome Dev",
_ => throw new PuppeteerException($"{channel} is not supported"),
};
+ case Platform.LinuxArm64:
case Platform.Linux:
return channel switch
{
@@ -86,17 +87,17 @@ internal static string ResolveSystemExecutablePath(Platform platform, ChromeRele
}
private static string[] ResolveDownloadPath(Platform platform, string buildId)
- => new string[]
- {
+ =>
+ [
buildId,
GetFolder(platform),
- $"chrome-{GetFolder(platform)}.zip",
- };
+ $"chrome-{GetFolder(platform)}.zip"
+ ];
private static string GetFolder(Platform platform)
=> platform switch
{
- Platform.Linux => "linux64",
+ Platform.Linux or Platform.LinuxArm64 => "linux64",
Platform.MacOSArm64 => "mac-arm64",
Platform.MacOS => "mac-x64",
Platform.Win32 => "win32",
diff --git a/lib/PuppeteerSharp/BrowserData/ChromeHeadlessShell.cs b/lib/PuppeteerSharp/BrowserData/ChromeHeadlessShell.cs
index 6c27559b2..ee7d00488 100644
--- a/lib/PuppeteerSharp/BrowserData/ChromeHeadlessShell.cs
+++ b/lib/PuppeteerSharp/BrowserData/ChromeHeadlessShell.cs
@@ -17,23 +17,23 @@ internal static string RelativeExecutablePath(Platform platform, string buildId)
Platform.MacOS or Platform.MacOSArm64 => Path.Combine(
"chrome-headless-shell-" + GetFolder(platform),
"chrome-headless-shell"),
- Platform.Linux => Path.Combine("chrome-headless-shell-linux64", "chrome-headless-shell"),
+ Platform.Linux or Platform.LinuxArm64 => Path.Combine("chrome-headless-shell-linux64", "chrome-headless-shell"),
Platform.Win32 or Platform.Win64 => Path.Combine("chrome-headless-shell-" + GetFolder(platform), "chrome-headless-shell.exe"),
_ => throw new ArgumentException("Invalid platform", nameof(platform)),
};
private static string[] ResolveDownloadPath(Platform platform, string buildId)
- => new string[]
- {
+ =>
+ [
buildId,
GetFolder(platform),
- $"chrome-headless-shell-{GetFolder(platform)}.zip",
- };
+ $"chrome-headless-shell-{GetFolder(platform)}.zip"
+ ];
private static string GetFolder(Platform platform)
=> platform switch
{
- Platform.Linux => "linux64",
+ Platform.Linux or Platform.LinuxArm64 => "linux64",
Platform.MacOSArm64 => "mac-arm64",
Platform.MacOS => "mac-x64",
Platform.Win32 => "win32",
diff --git a/lib/PuppeteerSharp/BrowserData/Chromium.cs b/lib/PuppeteerSharp/BrowserData/Chromium.cs
index ae6b9a58e..027db5a05 100644
--- a/lib/PuppeteerSharp/BrowserData/Chromium.cs
+++ b/lib/PuppeteerSharp/BrowserData/Chromium.cs
@@ -21,23 +21,23 @@ internal static string RelativeExecutablePath(Platform platform, string builId)
"Contents",
"MacOS",
"Chromium"),
- Platform.Linux => Path.Combine("chrome-linux", "chrome"),
+ Platform.Linux or Platform.LinuxArm64 => Path.Combine("chrome-linux", "chrome"),
Platform.Win32 or Platform.Win64 => Path.Combine("chrome-win", "chrome.exe"),
_ => throw new ArgumentException("Invalid platform", nameof(platform)),
};
private static string[] ResolveDownloadPath(Platform platform, string buildId)
- => new string[]
- {
+ =>
+ [
GetFolder(platform),
buildId,
- $"{GetArchive(platform, buildId)}.zip",
- };
+ $"{GetArchive(platform, buildId)}.zip"
+ ];
private static string GetArchive(Platform platform, string buildId)
=> platform switch
{
- Platform.Linux => "chrome-linux",
+ Platform.Linux or Platform.LinuxArm64 => "chrome-linux",
Platform.MacOS or Platform.MacOSArm64 => "chrome-mac",
// Windows archive name changed at r591479.
@@ -48,7 +48,7 @@ private static string GetArchive(Platform platform, string buildId)
private static string GetFolder(Platform platform)
=> platform switch
{
- Platform.Linux => "Linux_x64",
+ Platform.Linux or Platform.LinuxArm64 => "Linux_x64",
Platform.MacOSArm64 => "Mac_Arm",
Platform.MacOS => "Mac",
Platform.Win32 => "Win",
diff --git a/lib/PuppeteerSharp/BrowserData/Firefox.cs b/lib/PuppeteerSharp/BrowserData/Firefox.cs
index e08b0676a..956104fbe 100644
--- a/lib/PuppeteerSharp/BrowserData/Firefox.cs
+++ b/lib/PuppeteerSharp/BrowserData/Firefox.cs
@@ -90,7 +90,7 @@ internal static string RelativeExecutablePath(Platform platform, string buildId)
"Contents",
"MacOS",
"firefox"),
- Platform.Linux => Path.Combine("firefox", "firefox"),
+ Platform.Linux or Platform.LinuxArm64 => Path.Combine("firefox", "firefox"),
Platform.Win32 or Platform.Win64 => Path.Combine("firefox", "firefox.exe"),
_ => throw new ArgumentException("Invalid platform", nameof(platform)),
};
@@ -102,7 +102,7 @@ internal static string RelativeExecutablePath(Platform platform, string buildId)
"Contents",
"MacOS",
"firefox"),
- Platform.Linux => Path.Combine("firefox", "firefox"),
+ Platform.Linux or Platform.LinuxArm64 => Path.Combine("firefox", "firefox"),
Platform.Win32 or Platform.Win64 => Path.Combine("core", "firefox.exe"),
_ => throw new ArgumentException("Invalid platform", nameof(platform)),
};
@@ -162,6 +162,7 @@ private static string GetPlatformNameForUrl(Platform platform)
=> platform switch
{
Platform.Linux => "linux-x86_64",
+ Platform.LinuxArm64 => "linux-aarch64",
Platform.MacOS or Platform.MacOSArm64 => "mac",
Platform.Win32 => "win32",
Platform.Win64 => "win64",
@@ -171,7 +172,7 @@ private static string GetPlatformNameForUrl(Platform platform)
private static string GetFirefoxPlatform(Platform platform)
=> platform switch
{
- Platform.Linux => "linux",
+ Platform.Linux or Platform.LinuxArm64 => "linux",
Platform.MacOS => "mac",
Platform.MacOSArm64 => "mac_arm",
Platform.Win32 => "win32",
@@ -182,6 +183,7 @@ private static string GetFirefoxPlatform(Platform platform)
private static string GetArchiveNightly(Platform platform, string buildId)
=> platform switch
{
+ Platform.LinuxArm64 => $"firefox-{buildId}.en-US.{GetFirefoxPlatform(platform)}-aarch64.tar.{GetFormat(buildId)}",
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",
@@ -197,7 +199,7 @@ private static string GetFormat(string buildId)
private static string GetArchive(Platform platform, string buildId)
=> platform switch
{
- Platform.Linux => $"firefox-{buildId}.tar.bz2",
+ Platform.Linux or Platform.LinuxArm64 => $"firefox-{buildId}.tar.bz2",
Platform.MacOS or Platform.MacOSArm64 => $"Firefox {buildId}.dmg",
Platform.Win32 or Platform.Win64 =>
$"Firefox Setup {buildId}.exe",
diff --git a/lib/PuppeteerSharp/BrowserFetcher.cs b/lib/PuppeteerSharp/BrowserFetcher.cs
index 0b9059da8..55c1d0279 100644
--- a/lib/PuppeteerSharp/BrowserFetcher.cs
+++ b/lib/PuppeteerSharp/BrowserFetcher.cs
@@ -160,12 +160,16 @@ internal static Platform GetCurrentPlatform()
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
- return RuntimeInformation.OSArchitecture == Architecture.X64 ? Platform.Win64 : Platform.Win32;
+ return RuntimeInformation.OSArchitecture == Architecture.X64 ||
+ (RuntimeInformation.OSArchitecture == Architecture.Arm64 && IsWindows11()) ? Platform.Win64 : Platform.Win32;
}
return Platform.Unknown;
}
+ internal static bool IsWindows11()
+ => RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && Environment.OSVersion.Version.Build >= 22000;
+
internal static string GetBrowsersLocation()
{
var assembly = typeof(Puppeteer).Assembly;
diff --git a/lib/PuppeteerSharp/Platform.cs b/lib/PuppeteerSharp/Platform.cs
index b4acfca59..6c743052c 100644
--- a/lib/PuppeteerSharp/Platform.cs
+++ b/lib/PuppeteerSharp/Platform.cs
@@ -25,6 +25,11 @@ public enum Platform
///
Linux,
+ ///
+ /// Linux ARM64.
+ ///
+ LinuxArm64,
+
///
/// Win32.
///
diff --git a/lib/PuppeteerSharp/PuppeteerSharp.csproj b/lib/PuppeteerSharp/PuppeteerSharp.csproj
index da75ef3f2..dca72cafc 100644
--- a/lib/PuppeteerSharp/PuppeteerSharp.csproj
+++ b/lib/PuppeteerSharp/PuppeteerSharp.csproj
@@ -12,10 +12,10 @@
Headless Browser .NET API
PuppeteerSharp
- 20.2.1
- 20.2.1
- 20.2.1
- 20.2.1
+ 20.2.2
+ 20.2.2
+ 20.2.2
+ 20.2.2
false
false
embedded