@@ -27,7 +27,7 @@ public class BrowserFetcher : IBrowserFetcher
27
27
28
28
private const string PublishSingleFileLocalApplicationDataFolderName = "PuppeteerSharp" ;
29
29
30
- private static readonly Dictionary < Product , string > _hosts = new Dictionary < Product , string >
30
+ private static readonly Dictionary < Product , string > _hosts = new ( )
31
31
{
32
32
[ Product . Chrome ] = "https://storage.googleapis.com" ,
33
33
[ Product . Firefox ] = "https://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central" ,
@@ -37,15 +37,17 @@ public class BrowserFetcher : IBrowserFetcher
37
37
{
38
38
[ ( Product . Chrome , Platform . Linux ) ] = "{0}/chromium-browser-snapshots/Linux_x64/{1}/{2}.zip" ,
39
39
[ ( 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" ,
40
41
[ ( Product . Chrome , Platform . Win32 ) ] = "{0}/chromium-browser-snapshots/Win/{1}/{2}.zip" ,
41
42
[ ( Product . Chrome , Platform . Win64 ) ] = "{0}/chromium-browser-snapshots/Win_x64/{1}/{2}.zip" ,
42
43
[ ( 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" ,
43
45
[ ( Product . Firefox , Platform . MacOS ) ] = "{0}/firefox-{1}.en-US.{2}.dmg" ,
44
46
[ ( Product . Firefox , Platform . Win32 ) ] = "{0}/firefox-{1}.en-US.{2}.zip" ,
45
47
[ ( Product . Firefox , Platform . Win64 ) ] = "{0}/firefox-{1}.en-US.{2}.zip" ,
46
48
} ;
47
49
48
- private readonly WebClient _webClient = new WebClient ( ) ;
50
+ private readonly WebClient _webClient = new ( ) ;
49
51
private readonly CustomFileDownloadAction _customFileDownload ;
50
52
private bool _isDisposed ;
51
53
@@ -94,7 +96,7 @@ public BrowserFetcher(BrowserFetcherOptions options)
94
96
public string DownloadHost { get ; }
95
97
96
98
/// <inheritdoc/>
97
- public Platform Platform { get ; }
99
+ public Platform Platform { get ; set ; }
98
100
99
101
/// <inheritdoc/>
100
102
public Product Product { get ; }
@@ -122,6 +124,7 @@ public static string GetExecutablePath(Product product, Platform platform, strin
122
124
switch ( platform )
123
125
{
124
126
case Platform . MacOS :
127
+ case Platform . MacOSArm64 :
125
128
return Path . Combine (
126
129
folderPath ,
127
130
GetArchiveName ( product , platform , revision ) ,
@@ -146,6 +149,7 @@ public static string GetExecutablePath(Product product, Platform platform, strin
146
149
switch ( platform )
147
150
{
148
151
case Platform . MacOS :
152
+ case Platform . MacOSArm64 :
149
153
return Path . Combine (
150
154
folderPath ,
151
155
"Firefox Nightly.app" ,
@@ -337,7 +341,7 @@ internal static Platform GetCurrentPlatform()
337
341
{
338
342
if ( RuntimeInformation . IsOSPlatform ( OSPlatform . OSX ) )
339
343
{
340
- return Platform . MacOS ;
344
+ return RuntimeInformation . OSArchitecture == Architecture . Arm64 ? Platform . MacOSArm64 : Platform . MacOS ;
341
345
}
342
346
343
347
if ( RuntimeInformation . IsOSPlatform ( OSPlatform . Linux ) )
@@ -414,6 +418,7 @@ private static string GetArchiveName(Product product, Platform platform, string
414
418
return "chrome-linux" ;
415
419
416
420
case Platform . MacOS :
421
+ case Platform . MacOSArm64 :
417
422
return "chrome-mac" ;
418
423
419
424
case Platform . Win32 :
@@ -432,6 +437,7 @@ private static string GetArchiveName(Product product, Platform platform, string
432
437
return "linux" ;
433
438
434
439
case Platform . MacOS :
440
+ case Platform . MacOSArm64 :
435
441
return "mac" ;
436
442
437
443
case Platform . Win32 :
0 commit comments