diff --git a/src/node/BrowserFetcher.ts b/src/node/BrowserFetcher.ts index 20301e2462142..85bc9ff63fed0 100644 --- a/src/node/BrowserFetcher.ts +++ b/src/node/BrowserFetcher.ts @@ -41,6 +41,7 @@ const downloadURLs = { chrome: { linux: '%s/chromium-browser-snapshots/Linux_x64/%d/%s.zip', mac: '%s/chromium-browser-snapshots/Mac/%d/%s.zip', + mac_arm: '%s/chromium-browser-snapshots/Mac_Arm/%d/%s.zip', win32: '%s/chromium-browser-snapshots/Win/%d/%s.zip', win64: '%s/chromium-browser-snapshots/Win_x64/%d/%s.zip', }, @@ -67,7 +68,7 @@ const browserConfig = { * Supported platforms. * @public */ -export type Platform = 'linux' | 'mac' | 'win32' | 'win64'; +export type Platform = 'linux' | 'mac' | 'mac_arm' | 'win32' | 'win64'; function archiveName( product: Product, @@ -76,7 +77,7 @@ function archiveName( ): string { if (product === 'chrome') { if (platform === 'linux') return 'chrome-linux'; - if (platform === 'mac') return 'chrome-mac'; + if (platform === 'mac' || platform === 'mac_arm') return 'chrome-mac'; if (platform === 'win32' || platform === 'win64') { // Windows archive name changed at r591479. return parseInt(revision, 10) > 591479 ? 'chrome-win' : 'chrome-win32'; @@ -212,7 +213,8 @@ export class BrowserFetcher { } const platform = os.platform(); - if (platform === 'darwin') this._platform = 'mac'; + if (platform === 'darwin') + this._platform = os.arch() === 'arm64' ? 'mac_arm' : 'mac'; else if (platform === 'linux') this._platform = 'linux'; else if (platform === 'win32') this._platform = os.arch() === 'x64' ? 'win64' : 'win32'; @@ -295,8 +297,7 @@ export class BrowserFetcher { if (!(await existsAsync(this._downloadsFolder))) await mkdirAsync(this._downloadsFolder); - // Use Intel x86 builds on Apple M1 until native macOS arm64 - // Chromium builds are available. + // Use system Chromium builds on Linux ARM devices if (os.platform() !== 'darwin' && os.arch() === 'arm64') { handleArm64(); return; @@ -351,7 +352,7 @@ export class BrowserFetcher { const folderPath = this._getFolderPath(revision); let executablePath = ''; if (this._product === 'chrome') { - if (this._platform === 'mac') + if (this._platform === 'mac' || this._platform === 'mac_arm') executablePath = path.join( folderPath, archiveName(this._product, this._platform, revision), diff --git a/src/node/Launcher.ts b/src/node/Launcher.ts index 402ae0ad0d7f1..cf1cb72212826 100644 --- a/src/node/Launcher.ts +++ b/src/node/Launcher.ts @@ -118,8 +118,7 @@ class ChromeLauncher implements ProductLauncher { chromeExecutable = executablePathForChannel(channel); } else if (!executablePath) { - // Use Intel x86 builds on Apple M1 until native macOS arm64 - // Chromium builds are available. + // Use system Chromium builds on Linux ARM devices if (os.platform() !== 'darwin' && os.arch() === 'arm64') { chromeExecutable = '/usr/bin/chromium-browser'; } else { diff --git a/src/node/install.ts b/src/node/install.ts index d7e751f44ef87..7a165a76e392c 100644 --- a/src/node/install.ts +++ b/src/node/install.ts @@ -90,13 +90,9 @@ export async function downloadBrowser(): Promise { if (NPM_NO_PROXY) process.env.NO_PROXY = NPM_NO_PROXY; function onSuccess(localRevisions: string[]): void { - // Use Intel x86 builds on Apple M1 until native macOS arm64 - // Chromium builds are available. - if (os.platform() !== 'darwin' && os.arch() !== 'arm64') { - logPolitely( - `${supportedProducts[product]} (${revisionInfo.revision}) downloaded to ${revisionInfo.folderPath}` - ); - } + logPolitely( + `${supportedProducts[product]} (${revisionInfo.revision}) downloaded to ${revisionInfo.folderPath}` + ); localRevisions = localRevisions.filter( (revision) => revision !== revisionInfo.revision ); diff --git a/src/revisions.ts b/src/revisions.ts index 5c4694ea39032..288ffe4bb6b39 100644 --- a/src/revisions.ts +++ b/src/revisions.ts @@ -20,6 +20,6 @@ type Revisions = Readonly<{ }>; export const PUPPETEER_REVISIONS: Revisions = { - chromium: '901912', + chromium: '916291', firefox: 'latest', }; diff --git a/utils/check_availability.js b/utils/check_availability.js index fbc115c1a53f0..faedbb6868a4f 100755 --- a/utils/check_availability.js +++ b/utils/check_availability.js @@ -21,7 +21,7 @@ const https = require('https'); const BrowserFetcher = require('../lib/cjs/puppeteer/node/BrowserFetcher.js').BrowserFetcher; -const SUPPORTER_PLATFORMS = ['linux', 'mac', 'win32', 'win64']; +const SUPPORTER_PLATFORMS = ['linux', 'mac', 'mac_arm', 'win32', 'win64']; const fetchers = SUPPORTER_PLATFORMS.map( (platform) => new BrowserFetcher('', { platform }) ); @@ -139,6 +139,9 @@ async function checkOmahaProxyAvailability() { fetch( 'https://storage.googleapis.com/chromium-browser-snapshots/Mac/LAST_CHANGE' ), + fetch( + 'https://storage.googleapis.com/chromium-browser-snapshots/Mac_Arm/LAST_CHANGE' + ), fetch( 'https://storage.googleapis.com/chromium-browser-snapshots/Linux_x64/LAST_CHANGE' ), @@ -191,7 +194,7 @@ async function checkRangeAvailability({ toRevision, stopWhenAllAvailable, }) { - const table = new Table([10, 7, 7, 7, 7]); + const table = new Table([10, 7, 7, 7, 7, 7]); table.drawRow([''].concat(SUPPORTER_PLATFORMS)); const inc = fromRevision < toRevision ? 1 : -1;