chore: extract puppeteer launch options to type (#8448)
This commit is contained in:
parent
9f9a1a4dd5
commit
3f4451eff7
@ -30,6 +30,17 @@ import Launcher, { ProductLauncher } from './Launcher.js';
|
||||
import { PUPPETEER_REVISIONS } from '../revisions.js';
|
||||
import { Product } from '../common/Product.js';
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export interface PuppeteerLaunchOptions
|
||||
extends LaunchOptions,
|
||||
BrowserLaunchArgumentOptions,
|
||||
BrowserConnectOptions {
|
||||
product?: Product;
|
||||
extraPrefsFirefox?: Record<string, unknown>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extends the main {@link Puppeteer} class with Node specific behaviour for fetching and
|
||||
* downloading browsers.
|
||||
@ -143,14 +154,7 @@ export class PuppeteerNode extends Puppeteer {
|
||||
* @param options - Set of configurable options to set on the browser.
|
||||
* @returns Promise which resolves to browser instance.
|
||||
*/
|
||||
launch(
|
||||
options: LaunchOptions &
|
||||
BrowserLaunchArgumentOptions &
|
||||
BrowserConnectOptions & {
|
||||
product?: Product;
|
||||
extraPrefsFirefox?: Record<string, unknown>;
|
||||
} = {}
|
||||
): Promise<Browser> {
|
||||
launch(options: PuppeteerLaunchOptions = {}): Promise<Browser> {
|
||||
if (options.product) this._productName = options.product;
|
||||
return this._launcher.launch(options);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user