Skip to content

Add support to ARM browsers #2937

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 17, 2025
Merged

Add support to ARM browsers #2937

merged 3 commits into from
Jul 17, 2025

Conversation

kblok
Copy link
Member

@kblok kblok commented Jul 16, 2025

closes #2929

@kblok kblok requested a review from Copilot July 16, 2025 14:08
Copilot

This comment was marked as outdated.

@kblok kblok requested a review from Copilot July 16, 2025 14:32
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds ARM64 support by extending platform detection and adjusting browser data paths accordingly.

  • Bumped package version to 20.2.2
  • Introduced Platform.LinuxArm64 and updated BrowserFetcher to detect Windows ARM64 on Windows 11
  • Updated executable paths and archive names for Firefox, Chromium, ChromeHeadlessShell, and Chrome to include Linux ARM64

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
lib/PuppeteerSharp/PuppeteerSharp.csproj Bumped version from 20.2.1 to 20.2.2
lib/PuppeteerSharp/Platform.cs Added new Platform.LinuxArm64 enum
lib/PuppeteerSharp/BrowserFetcher.cs Updated GetCurrentPlatform and added IsWindows11 helper
lib/PuppeteerSharp/BrowserData/Firefox.cs Extended RelativeExecutablePath, GetPlatformNameForUrl, and archive methods to support LinuxArm64
lib/PuppeteerSharp/BrowserData/Chromium.cs Updated RelativeExecutablePath, ResolveDownloadPath, and archive methods for LinuxArm64
lib/PuppeteerSharp/BrowserData/ChromeHeadlessShell.cs Adjusted RelativeExecutablePath, ResolveDownloadPath, and folder logic for LinuxArm64
lib/PuppeteerSharp/BrowserData/Chrome.cs Added LinuxArm64 in system executable resolution and download path logic
Comments suppressed due to low confidence (2)

lib/PuppeteerSharp/BrowserFetcher.cs:170

  • [nitpick] Add an XML doc comment explaining the Windows 11 detection logic and why build number >= 22000 is used.
        internal static bool IsWindows11()

lib/PuppeteerSharp/BrowserData/Firefox.cs:93

  • Add unit tests covering the new Platform.LinuxArm64 branch in RelativeExecutablePath to verify correct executable paths for ARM64.
                        Platform.Linux or Platform.LinuxArm64 => Path.Combine("firefox", "firefox"),

@@ -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 ||
Copy link
Preview

Copilot AI Jul 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider introducing a dedicated Platform.WinArm64 enum or a helper to explicitly represent Windows ARM64 rather than mapping it to Win64 for clarity in ARM support.

Copilot uses AI. Check for mistakes.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not yet

@@ -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"),
Copy link
Preview

Copilot AI Jul 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] There's repeated grouping of Platform.Linux and Platform.LinuxArm64; consider extracting a helper (e.g., IsLinuxPlatform) or shared method to reduce duplication across switch statements.

Suggested change
Platform.Linux or Platform.LinuxArm64 => Path.Combine("chrome-linux", "chrome"),
_ when IsLinuxPlatform(platform) => Path.Combine("chrome-linux", "chrome"),

Copilot uses AI. Check for mistakes.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nah

@kblok kblok merged commit de7b94c into master Jul 17, 2025
39 of 43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: Add Windows on Arm Support
1 participant