mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
fix: FirefoxLauncher should not use BrowserFetcher in puppeteer-core (#8920)
* fix: FirefoxLauncher should not use BrowserFetcher in puppeteer-core Closes #8919 Co-authored-by: Thiago Perrotta <tbperrotta@gmail.com>
This commit is contained in:
parent
d8830cbc55
commit
f2e8de777f
@ -127,3 +127,31 @@ echo '{"type":"module"}' >>$TMPDIR/package.json
|
|||||||
npm install --loglevel silent "${tarball}"
|
npm install --loglevel silent "${tarball}"
|
||||||
node --input-type="module" --eval="import puppeteer from 'puppeteer-core'"
|
node --input-type="module" --eval="import puppeteer from 'puppeteer-core'"
|
||||||
node --input-type="module" --eval="import 'puppeteer-core/lib/esm/puppeteer/revisions.js';"
|
node --input-type="module" --eval="import 'puppeteer-core/lib/esm/puppeteer/revisions.js';"
|
||||||
|
|
||||||
|
echo "Testing... Puppeteer Core launch with executablePath"
|
||||||
|
TMPDIR="$(mktemp -d)"
|
||||||
|
cd "$TMPDIR"
|
||||||
|
echo '{"type":"module"}' >> "$TMPDIR/package.json"
|
||||||
|
npm install --loglevel silent "${tarball}"
|
||||||
|
# The test tries to launch the node process because
|
||||||
|
# real browsers are not downloaded by puppeteer-core.
|
||||||
|
# The expected error is "Failed to launch the browser process"
|
||||||
|
# so the test verifies that it does not fail for other reasons.
|
||||||
|
node --input-type="module" --eval="
|
||||||
|
import puppeteer from 'puppeteer-core';
|
||||||
|
(async () => {
|
||||||
|
puppeteer.launch({
|
||||||
|
product: 'firefox',
|
||||||
|
executablePath: 'node'
|
||||||
|
}).catch(error => error.message.includes('Failed to launch the browser process') ? process.exit(0) : process.exit(1));
|
||||||
|
})();
|
||||||
|
"
|
||||||
|
node --input-type="module" --eval="
|
||||||
|
import puppeteer from 'puppeteer-core';
|
||||||
|
(async () => {
|
||||||
|
puppeteer.launch({
|
||||||
|
product: 'chrome',
|
||||||
|
executablePath: 'node'
|
||||||
|
}).catch(error => error.message.includes('Failed to launch the browser process') ? process.exit(0) : process.exit(1));
|
||||||
|
})();
|
||||||
|
"
|
||||||
|
@ -113,7 +113,9 @@ export class FirefoxLauncher implements ProductLauncher {
|
|||||||
firefoxArguments.push(userDataDir);
|
firefoxArguments.push(userDataDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!this._isPuppeteerCore) {
|
||||||
await this._updateRevision();
|
await this._updateRevision();
|
||||||
|
}
|
||||||
let firefoxExecutable = executablePath;
|
let firefoxExecutable = executablePath;
|
||||||
if (!executablePath) {
|
if (!executablePath) {
|
||||||
const {missingText, executablePath} = resolveExecutablePath(this);
|
const {missingText, executablePath} = resolveExecutablePath(this);
|
||||||
|
Loading…
Reference in New Issue
Block a user