PuppeteerBrowserPoolOptions
Hierarchy
- Omit<BrowserPoolOptions, browserPlugins>
- BrowserPoolHooks<ReturnType<PuppeteerPlugin[createController]>, ReturnType<PuppeteerPlugin[createLaunchContext]>, Page>
- PuppeteerBrowserPoolOptions
Index
Properties
Properties
optionalinheritedcloseInactiveBrowserAfterSecs
optionalconfiguration
Configuration to read the browser defaults from. Defaults to the global configuration.
optionalinheritedfingerprintOptions
optionalheadless
Whether to run the browser in headless mode. Shorthand for launchContext.launchOptions.headless.
Defaults to true, and can also be set via Configuration.
optionallaunchContext
How to launch the browser: proxy, user data dir, whether to use full Chrome, ...
optionalinheritedmaxOpenPagesPerBrowser
Sets the maximum number of pages that can be open in a browser at the same time. Once reached, a new browser will be launched to handle the excess.
optionalinheritedoperationTimeoutSecs
As we know from experience, async operations of the underlying libraries,
such as launching a browser or opening a new page, can get stuck.
To prevent BrowserPool from getting stuck, we add a timeout
to those operations and you can configure it with this option.
optionalinheritedpostLaunchHooks
Post-launch hooks are executed as soon as a browser is launched.
The hooks are called with two arguments:
pageId: string and browserController: BrowserController
To guarantee order of execution before other hooks in the same browser,
the BrowserController methods cannot be used until the post-launch
hooks complete. If you attempt to call await browserController.close() from
a post-launch hook, it will deadlock the process. This API is subject to change.
optionalinheritedpostPageCloseHooks
Post-page-close hooks allow you to do page related clean up.
The hooks are called with two arguments:
pageId: string and browserController: BrowserController
optionalinheritedpostPageCreateHooks
Post-page-create hooks are called right after a new page is created
and all internal actions of Browser Pool are completed. This is the
place to make changes to a page that you would like to apply to all
pages. Such as injecting a JavaScript library into all pages.
The hooks are called with two arguments:
page: Page and browserController: BrowserController
optionalinheritedpreLaunchHooks
Pre-launch hooks are executed just before a browser is launched and provide
a good opportunity to dynamically change the launch options.
The hooks are called with two arguments:
pageId: string and launchContext: LaunchContext
optionalinheritedprePageCloseHooks
Pre-page-close hooks give you the opportunity to make last second changes
in a page that's about to be closed, such as saving a snapshot or updating
state.
The hooks are called with two arguments:
page: Page and browserController: BrowserController
optionalinheritedprePageCreateHooks
Pre-page-create hooks are executed just before a new page is created. They
are useful to make dynamic changes to the browser before opening a page.
The hooks are called with three arguments:
pageId: string, browserController: BrowserController and
pageOptions: object|undefined - This only works if the underlying BrowserController supports new page options.
So far, new page options are only supported by PlaywrightController in incognito contexts.
If the page options are not supported by BrowserController the pageOptions argument is undefined.
optionalinheritedretireBrowserAfterPageCount
Browsers tend to get bloated after processing a lot of pages. This option configures the maximum number of processed pages after which the browser will automatically retire and close. A new browser will launch in its place. The browser might be retired sooner if the connected Session is retired. You can change session retirement behavior using SessionPoolOptions.
optionalinheritedretireInactiveBrowserAfterSecs
Browsers are marked as retired after they have been inactive for a certain amount of time. This option sets the interval at which the browsers are checked and retired if they are inactive.
Retired browsers are closed after all their pages are closed.
Browsers normally close immediately after their last page is processed. However, there could be situations where this does not happen. Browser Pool makes sure all inactive browsers are closed regularly, to free resources.