feat: support fetching and launching on Apple M1
Issue: #6495, #6634, #6641, #6614
This commit is contained in:
parent
50b810dab7
commit
9a8479a52a
@ -111,10 +111,15 @@ function downloadURL(
|
||||
function handleArm64(): void {
|
||||
fs.stat('/usr/bin/chromium-browser', function (err, stats) {
|
||||
if (stats === undefined) {
|
||||
console.error(`The chromium binary is not available for arm64: `);
|
||||
console.error(`If you are on Ubuntu, you can install with: `);
|
||||
console.error(`\n apt-get install chromium-browser\n`);
|
||||
throw new Error();
|
||||
fs.stat('/usr/bin/chromium', function (err, stats) {
|
||||
if (stats === undefined) {
|
||||
console.error(`The chromium binary is not available for arm64.`);
|
||||
console.error(`If you are on Ubuntu, you can install with: `);
|
||||
console.error(`\n sudo apt install chromium\n`);
|
||||
console.error(`\n sudo apt install chromium-browser\n`);
|
||||
throw new Error();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -104,12 +104,14 @@ class ChromeLauncher implements ProductLauncher {
|
||||
}
|
||||
|
||||
let chromeExecutable = executablePath;
|
||||
if (os.arch() === 'arm64') {
|
||||
chromeExecutable = '/usr/bin/chromium-browser';
|
||||
} else if (!executablePath) {
|
||||
const { missingText, executablePath } = resolveExecutablePath(this);
|
||||
if (missingText) throw new Error(missingText);
|
||||
chromeExecutable = executablePath;
|
||||
if (!executablePath) {
|
||||
if (os.arch() === 'arm64') {
|
||||
chromeExecutable = '/usr/bin/chromium-browser';
|
||||
} else {
|
||||
const { missingText, executablePath } = resolveExecutablePath(this);
|
||||
if (missingText) throw new Error(missingText);
|
||||
chromeExecutable = executablePath;
|
||||
}
|
||||
}
|
||||
|
||||
const usePipe = chromeArguments.includes('--remote-debugging-pipe');
|
||||
|
Loading…
Reference in New Issue
Block a user