mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
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 {
|
function handleArm64(): void {
|
||||||
fs.stat('/usr/bin/chromium-browser', function (err, stats) {
|
fs.stat('/usr/bin/chromium-browser', function (err, stats) {
|
||||||
if (stats === undefined) {
|
if (stats === undefined) {
|
||||||
console.error(`The chromium binary is not available for arm64: `);
|
fs.stat('/usr/bin/chromium', function (err, stats) {
|
||||||
console.error(`If you are on Ubuntu, you can install with: `);
|
if (stats === undefined) {
|
||||||
console.error(`\n apt-get install chromium-browser\n`);
|
console.error(`The chromium binary is not available for arm64.`);
|
||||||
throw new Error();
|
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;
|
let chromeExecutable = executablePath;
|
||||||
if (os.arch() === 'arm64') {
|
if (!executablePath) {
|
||||||
chromeExecutable = '/usr/bin/chromium-browser';
|
if (os.arch() === 'arm64') {
|
||||||
} else if (!executablePath) {
|
chromeExecutable = '/usr/bin/chromium-browser';
|
||||||
const { missingText, executablePath } = resolveExecutablePath(this);
|
} else {
|
||||||
if (missingText) throw new Error(missingText);
|
const { missingText, executablePath } = resolveExecutablePath(this);
|
||||||
chromeExecutable = executablePath;
|
if (missingText) throw new Error(missingText);
|
||||||
|
chromeExecutable = executablePath;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const usePipe = chromeArguments.includes('--remote-debugging-pipe');
|
const usePipe = chromeArguments.includes('--remote-debugging-pipe');
|
||||||
|
Loading…
Reference in New Issue
Block a user