@@ -27,7 +27,7 @@ public class BrowserFetcher : IBrowserFetcher
2727
2828 private const string PublishSingleFileLocalApplicationDataFolderName = "PuppeteerSharp" ;
2929
30- private static readonly Dictionary < Product , string > _hosts = new Dictionary < Product , string >
30+ private static readonly Dictionary < Product , string > _hosts = new ( )
3131 {
3232 [ Product . Chrome ] = "https://storage.googleapis.com" ,
3333 [ Product . Firefox ] = "https://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central" ,
@@ -37,15 +37,17 @@ public class BrowserFetcher : IBrowserFetcher
3737 {
3838 [ ( Product . Chrome , Platform . Linux ) ] = "{0}/chromium-browser-snapshots/Linux_x64/{1}/{2}.zip" ,
3939 [ ( Product . Chrome , Platform . MacOS ) ] = "{0}/chromium-browser-snapshots/Mac/{1}/{2}.zip" ,
40+ [ ( Product . Chrome , Platform . MacOSArm64 ) ] = "{0}/chromium-browser-snapshots/Mac_Arm/{1}/{2}.zip" ,
4041 [ ( Product . Chrome , Platform . Win32 ) ] = "{0}/chromium-browser-snapshots/Win/{1}/{2}.zip" ,
4142 [ ( Product . Chrome , Platform . Win64 ) ] = "{0}/chromium-browser-snapshots/Win_x64/{1}/{2}.zip" ,
4243 [ ( Product . Firefox , Platform . Linux ) ] = "{0}/firefox-{1}.en-US.{2}-x86_64.tar.bz2" ,
44+ [ ( Product . Firefox , Platform . MacOSArm64 ) ] = "{0}/firefox-{1}.en-US.{2}.dmg" ,
4345 [ ( Product . Firefox , Platform . MacOS ) ] = "{0}/firefox-{1}.en-US.{2}.dmg" ,
4446 [ ( Product . Firefox , Platform . Win32 ) ] = "{0}/firefox-{1}.en-US.{2}.zip" ,
4547 [ ( Product . Firefox , Platform . Win64 ) ] = "{0}/firefox-{1}.en-US.{2}.zip" ,
4648 } ;
4749
48- private readonly WebClient _webClient = new WebClient ( ) ;
50+ private readonly WebClient _webClient = new ( ) ;
4951 private readonly CustomFileDownloadAction _customFileDownload ;
5052 private bool _isDisposed ;
5153
@@ -94,7 +96,7 @@ public BrowserFetcher(BrowserFetcherOptions options)
9496 public string DownloadHost { get ; }
9597
9698 /// <inheritdoc/>
97- public Platform Platform { get ; }
99+ public Platform Platform { get ; set ; }
98100
99101 /// <inheritdoc/>
100102 public Product Product { get ; }
@@ -122,6 +124,7 @@ public static string GetExecutablePath(Product product, Platform platform, strin
122124 switch ( platform )
123125 {
124126 case Platform . MacOS :
127+ case Platform . MacOSArm64 :
125128 return Path . Combine (
126129 folderPath ,
127130 GetArchiveName ( product , platform , revision ) ,
@@ -146,6 +149,7 @@ public static string GetExecutablePath(Product product, Platform platform, strin
146149 switch ( platform )
147150 {
148151 case Platform . MacOS :
152+ case Platform . MacOSArm64 :
149153 return Path . Combine (
150154 folderPath ,
151155 "Firefox Nightly.app" ,
@@ -337,7 +341,7 @@ internal static Platform GetCurrentPlatform()
337341 {
338342 if ( RuntimeInformation . IsOSPlatform ( OSPlatform . OSX ) )
339343 {
340- return Platform . MacOS ;
344+ return RuntimeInformation . OSArchitecture == Architecture . Arm64 ? Platform . MacOSArm64 : Platform . MacOS ;
341345 }
342346
343347 if ( RuntimeInformation . IsOSPlatform ( OSPlatform . Linux ) )
@@ -414,6 +418,7 @@ private static string GetArchiveName(Product product, Platform platform, string
414418 return "chrome-linux" ;
415419
416420 case Platform . MacOS :
421+ case Platform . MacOSArm64 :
417422 return "chrome-mac" ;
418423
419424 case Platform . Win32 :
@@ -432,6 +437,7 @@ private static string GetArchiveName(Product product, Platform platform, string
432437 return "linux" ;
433438
434439 case Platform . MacOS :
440+ case Platform . MacOSArm64 :
435441 return "mac" ;
436442
437443 case Platform . Win32 :
0 commit comments