Skip to content

Commit bc0af57

Browse files
authored
feat: support download of native WebKit build for Apple M1 (#4648)
1 parent add7ce7 commit bc0af57

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/install/browserFetcher.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ function getDownloadUrl(browserName: BrowserName, revision: number, platform: Br
7878
['mac10.14', '%s/builds/chromium/%s/chromium-mac.zip'],
7979
['mac10.15', '%s/builds/chromium/%s/chromium-mac.zip'],
8080
['mac11.0', '%s/builds/chromium/%s/chromium-mac.zip'],
81+
['mac11.0-arm64', '%s/builds/chromium/%s/chromium-mac.zip'],
8182
['win32', '%s/builds/chromium/%s/chromium-win32.zip'],
8283
['win64', '%s/builds/chromium/%s/chromium-win64.zip'],
8384
]).get(platform);
@@ -103,6 +104,7 @@ function getDownloadUrl(browserName: BrowserName, revision: number, platform: Br
103104
['mac10.14', '%s/builds/firefox/%s/firefox-mac-10.14.zip'],
104105
['mac10.15', '%s/builds/firefox/%s/firefox-mac-10.14.zip'],
105106
['mac11.0', '%s/builds/firefox/%s/firefox-mac-10.14.zip'],
107+
['mac11.0-arm64', '%s/builds/firefox/%s/firefox-mac-10.14.zip'],
106108
['win32', '%s/builds/firefox/%s/firefox-win32.zip'],
107109
['win64', '%s/builds/firefox/%s/firefox-win64.zip'],
108110
]).get(platform);
@@ -128,6 +130,7 @@ function getDownloadUrl(browserName: BrowserName, revision: number, platform: Br
128130
['mac10.14', '%s/builds/webkit/%s/webkit-mac-10.14.zip'],
129131
['mac10.15', '%s/builds/webkit/%s/webkit-mac-10.15.zip'],
130132
['mac11.0', '%s/builds/webkit/%s/webkit-mac-10.15.zip'],
133+
['mac11.0-arm64', '%s/builds/webkit/%s/webkit-mac-11.0-arm64.zip'],
131134
['win32', '%s/builds/webkit/%s/webkit-win64.zip'],
132135
['win64', '%s/builds/webkit/%s/webkit-win64.zip'],
133136
]).get(platform);

src/utils/browserPaths.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { getUbuntuVersionSync } from './ubuntuVersion';
2222
import { getFromENV } from './utils';
2323

2424
export type BrowserName = 'chromium'|'webkit'|'firefox'|'clank';
25-
export type BrowserPlatform = 'win32'|'win64'|'mac10.13'|'mac10.14'|'mac10.15'|'mac11.0'|'ubuntu18.04'|'ubuntu20.04';
25+
export type BrowserPlatform = 'win32'|'win64'|'mac10.13'|'mac10.14'|'mac10.15'|'mac11.0'|'mac11.0-arm64'|'ubuntu18.04'|'ubuntu20.04';
2626
export type BrowserDescriptor = {
2727
name: BrowserName,
2828
revision: string,
@@ -35,7 +35,8 @@ export const hostPlatform = ((): BrowserPlatform => {
3535
const macVersion = execSync('sw_vers -productVersion', {
3636
stdio: ['ignore', 'pipe', 'ignore']
3737
}).toString('utf8').trim().split('.').slice(0, 2).join('.');
38-
return `mac${macVersion}` as BrowserPlatform;
38+
const archSuffix = os.arch() === 'arm64' ? '-arm64' : '';
39+
return `mac${macVersion}${archSuffix}` as BrowserPlatform;
3940
}
4041
if (platform === 'linux') {
4142
const ubuntuVersion = getUbuntuVersionSync();

0 commit comments

Comments
 (0)