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 { PUPPETEER_REVISIONS } from '../revisions.js';
|
||||||
import { Product } from '../common/Product.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
|
* Extends the main {@link Puppeteer} class with Node specific behaviour for fetching and
|
||||||
* downloading browsers.
|
* downloading browsers.
|
||||||
@ -143,14 +154,7 @@ export class PuppeteerNode extends Puppeteer {
|
|||||||
* @param options - Set of configurable options to set on the browser.
|
* @param options - Set of configurable options to set on the browser.
|
||||||
* @returns Promise which resolves to browser instance.
|
* @returns Promise which resolves to browser instance.
|
||||||
*/
|
*/
|
||||||
launch(
|
launch(options: PuppeteerLaunchOptions = {}): Promise<Browser> {
|
||||||
options: LaunchOptions &
|
|
||||||
BrowserLaunchArgumentOptions &
|
|
||||||
BrowserConnectOptions & {
|
|
||||||
product?: Product;
|
|
||||||
extraPrefsFirefox?: Record<string, unknown>;
|
|
||||||
} = {}
|
|
||||||
): Promise<Browser> {
|
|
||||||
if (options.product) this._productName = options.product;
|
if (options.product) this._productName = options.product;
|
||||||
return this._launcher.launch(options);
|
return this._launcher.launch(options);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user