-
-
Notifications
You must be signed in to change notification settings - Fork 468
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
Conversation
There was a problem hiding this 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 updatedBrowserFetcher
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 inRelativeExecutablePath
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 || |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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"), |
There was a problem hiding this comment.
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.
Platform.Linux or Platform.LinuxArm64 => Path.Combine("chrome-linux", "chrome"), | |
_ when IsLinuxPlatform(platform) => Path.Combine("chrome-linux", "chrome"), |
Copilot uses AI. Check for mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nah
Co-authored-by: Copilot <[email protected]>
closes #2929