mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
fix: firefox revision resolution should not update chrome revision (#9507)
Drive-by: don't override options in PuppeteerNode if they are provided. Closes #9461
This commit is contained in:
parent
47f51c8a7d
commit
f59bbf4014
@ -194,7 +194,7 @@ export class FirefoxLauncher extends ProductLauncher {
|
||||
});
|
||||
const localRevisions = browserFetcher.localRevisions();
|
||||
if (localRevisions[0]) {
|
||||
this.puppeteer.configuration.browserRevision = localRevisions[0];
|
||||
this.actualBrowserRevision = localRevisions[0];
|
||||
}
|
||||
}
|
||||
return this.resolveExecutablePath();
|
||||
|
@ -38,6 +38,11 @@ export class ProductLauncher {
|
||||
*/
|
||||
puppeteer: PuppeteerNode;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
protected actualBrowserRevision?: string;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
@ -65,6 +70,15 @@ export class ProductLauncher {
|
||||
throw new Error('Not implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
* Set only for Firefox, after the launcher resolves the `latest` revision to
|
||||
* the actual revision.
|
||||
* @internal
|
||||
*/
|
||||
getActualBrowserRevision(): string | undefined {
|
||||
return this.actualBrowserRevision;
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
|
@ -217,7 +217,11 @@ export class PuppeteerNode extends Puppeteer {
|
||||
* @internal
|
||||
*/
|
||||
get browserRevision(): string {
|
||||
return this.configuration.browserRevision ?? this.defaultBrowserRevision!;
|
||||
return (
|
||||
this.#_launcher?.getActualBrowserRevision() ??
|
||||
this.configuration.browserRevision ??
|
||||
this.defaultBrowserRevision!
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -292,19 +296,22 @@ export class PuppeteerNode extends Puppeteer {
|
||||
options: Partial<BrowserFetcherOptions> = {}
|
||||
): BrowserFetcher {
|
||||
const downloadPath = this.defaultDownloadPath;
|
||||
if (downloadPath) {
|
||||
if (!options.path && downloadPath) {
|
||||
options.path = downloadPath;
|
||||
}
|
||||
if (!options.path) {
|
||||
throw new Error('A `path` must be specified for `puppeteer-core`.');
|
||||
}
|
||||
if (this.configuration.experiments?.macArmChromiumEnabled) {
|
||||
if (
|
||||
!('useMacOSARMBinary' in options) &&
|
||||
this.configuration.experiments?.macArmChromiumEnabled
|
||||
) {
|
||||
options.useMacOSARMBinary = true;
|
||||
}
|
||||
if (this.configuration.downloadHost) {
|
||||
if (!('host' in options) && this.configuration.downloadHost) {
|
||||
options.host = this.configuration.downloadHost;
|
||||
}
|
||||
if (this.configuration.defaultProduct) {
|
||||
if (!('product' in options) && this.configuration.defaultProduct) {
|
||||
options.product = this.configuration.defaultProduct;
|
||||
}
|
||||
return new BrowserFetcher(options as BrowserFetcherOptions);
|
||||
|
Loading…
Reference in New Issue
Block a user