fix: update documentation on configuring puppeteer (#9150)

This PR updates the docs regarding configuring puppeteer. In addition,
some changes have been made to the documentation generator to show
default values on the documentation site.

Also fixes: https://github.com/puppeteer/puppeteer/pull/9144
This commit is contained in:
jrandolf 2022-10-24 09:07:05 +02:00 committed by GitHub
parent 4bf338b26d
commit f07ad2c661
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
734 changed files with 2204 additions and 1605 deletions

View File

@ -5,7 +5,7 @@
<img src="https://user-images.githubusercontent.com/10379601/29446482-04f7036a-841f-11e7-9872-91d1fc2ea683.png" height="200" align="right"/>
#### [API](https://pptr.dev/api) | [FAQ](https://pptr.dev/faq) | [Contributing](https://pptr.dev/contributing) | [Troubleshooting](https://pptr.dev/troubleshooting)
#### [Guides](https://pptr.dev/guides) | [API](https://pptr.dev/api) | [FAQ](https://pptr.dev/faq) | [Contributing](https://pptr.dev/contributing) | [Troubleshooting](https://pptr.dev/troubleshooting)
> Puppeteer is a Node.js library which provides a high-level API to control
> Chrome/Chromium over the
@ -49,51 +49,32 @@ Chromium (~170MB macOS, ~282MB Linux, ~280MB Windows) that is
with Puppeteer. For a version of Puppeteer without installation, see
[`puppeteer-core`](#puppeteer-core).
#### Environment Variables
#### Configuring Puppeteer
Puppeteer looks for certain
[environment variables](https://en.wikipedia.org/wiki/Environment_variable) for
customizing behavior. If Puppeteer doesn't find them in the environment during
the installation step, a lowercased variant of these variables will be used from
the [npm config](https://docs.npmjs.com/cli/config).
Puppeteer uses several defaults that can be customized through configuration
files.
- `HTTP_PROXY`, `HTTPS_PROXY`, `NO_PROXY` - defines HTTP proxy settings that are
used to download and run the browser.
- `PUPPETEER_CACHE_DIR` - defines the directory to be used by Puppeteer for
caching. Defaults to
[`os.homedir()/.cache/puppeteer`](https://nodejs.org/api/os.html#os_os_homedir).
- `PUPPETEER_SKIP_CHROMIUM_DOWNLOAD` - do not download bundled Chromium during
installation step.
- `PUPPETEER_TMP_DIR` - defines the directory to be used by Puppeteer for
creating temporary files. Defaults to
[`os.tmpdir()`](https://nodejs.org/api/os.html#os_os_tmpdir).
- `PUPPETEER_DOWNLOAD_HOST` - specifies the URL prefix that is used to download
Chromium. Note: this includes protocol and might even include path prefix.
Defaults to `https://storage.googleapis.com`.
- `PUPPETEER_DOWNLOAD_PATH` - specifies the path for the downloads folder.
Defaults to `<cache>/chromium`, where `<cache>` is Puppeteer's cache
directory.
- `PUPPETEER_BROWSER_REVISION` - specifies a certain version of the browser
you'd like Puppeteer to use. See
[`puppeteer.launch`](https://pptr.dev/api/puppeteer.puppeteernode.launch) on
how executable path is inferred.
- `PUPPETEER_EXECUTABLE_PATH` - specifies an executable path to be used in
[`puppeteer.launch`](https://pptr.dev/api/puppeteer.puppeteernode.launch).
- `PUPPETEER_PRODUCT` - specifies which browser you'd like Puppeteer to use.
Must be either `chrome` or `firefox`. This can also be used during
installation to fetch the recommended browser binary. Setting `product`
programmatically in
[`puppeteer.launch`](https://pptr.dev/api/puppeteer.puppeteernode.launch)
supersedes this environment variable.
- `PUPPETEER_EXPERIMENTAL_CHROMIUM_MAC_ARM` — specify Puppeteer download
Chromium for Apple M1. On Apple M1 devices Puppeteer by default downloads the
version for Intel's processor which runs via Rosetta. It works without any
problems, however, with this option, you should get more efficient resource
usage (CPU and RAM) that could lead to a faster execution time.
For example, to change the default cache directory Puppeteer uses to install
browsers, you can add a `.puppeteerrc.cjs` (or `puppeteer.config.cjs`) at the
root of your application with the contents
Environment variables except for `PUPPETEER_CACHE_DIR` are not used for
[`puppeteer-core`](#puppeteer-core) since core does not automatically handle
browser downloading.
```js
const {join} = require('path');
/**
* @type {import("puppeteer").Configuration}
*/
module.exports = {
// Changes the cache location for Puppeteer.
cacheDirectory: join(__dirname, '.cache', 'puppeteer'),
};
```
After adding the configuration file, you will need to remove and reinstall
`puppeteer` for it to take effect.
See [Configuring
Puppeteer](https://pptr.dev/guides/configuring-puppeteer) for more information.
#### `puppeteer-core`
@ -104,21 +85,21 @@ Every release since v1.7.0 we publish two packages:
`puppeteer` is a _product_ for browser automation. When installed, it downloads
a version of Chromium, which it then drives using `puppeteer-core`. Being an
end-user product, `puppeteer` supports a bunch of convenient `PUPPETEER_*` env
variables to tweak its behavior.
end-user product, `puppeteer` automates several workflows using reasonable defaults [that can be customized](https://pptr.dev/guides/configuring-puppeteer).
`puppeteer-core` is a _library_ to help drive anything that supports DevTools
protocol. `puppeteer-core` doesn't download Chromium when installed. Being a
library, `puppeteer-core` is fully driven through its programmatic interface.
protocol. Being a library, `puppeteer-core` is fully driven through its
programmatic interface implying no defaults are assumed and `puppeteer-core`
will not download Chromium when installed.
You should only use `puppeteer-core` if you are
[connecting to a remote browser](https://pptr.dev/api/puppeteer.puppeteer.connect)
or [managing browsers yourself](https://pptr.dev/api/puppeteer.browserfetcher).
If you are managing browsers yourself, you will need to call
You should use `puppeteer-core` if you are [connecting to a remote
browser](https://pptr.dev/api/puppeteer.puppeteer.connect) or [managing browsers
yourself](https://pptr.dev/api/puppeteer.browserfetcher). If you are managing
browsers yourself, you will need to call
[`puppeteer.launch`](https://pptr.dev/api/puppeteer.puppeteernode.launch) with
an explicit
an an explicit
[`executablePath`](https://pptr.dev/api/puppeteer.launchoptions.executablepath)
or [`channel`](https://pptr.dev/api/puppeteer.launchoptions.channel).
(or [`channel`](https://pptr.dev/api/puppeteer.launchoptions.channel) if it's installed in a standard location).
When using `puppeteer-core`, remember to change the import:

View File

@ -73,7 +73,7 @@ sidebar_label: API
| [CDPSessionOnMessageObject](./puppeteer.cdpsessiononmessageobject.md) | |
| [ClickOptions](./puppeteer.clickoptions.md) | |
| [CommonEventEmitter](./puppeteer.commoneventemitter.md) | |
| [Configuration](./puppeteer.configuration.md) | |
| [Configuration](./puppeteer.configuration.md) | <p>Defines options to configure Puppeteer's behavior during installation and runtime.</p><p>See individual properties for more information.</p> |
| [ConnectionCallback](./puppeteer.connectioncallback.md) | |
| [ConnectionTransport](./puppeteer.connectiontransport.md) | |
| [ConnectOptions](./puppeteer.connectoptions.md) | |
@ -84,6 +84,7 @@ sidebar_label: API
| [CSSCoverageOptions](./puppeteer.csscoverageoptions.md) | Set of configurable options for CSS coverage. |
| [CustomQueryHandler](./puppeteer.customqueryhandler.md) | |
| [Device](./puppeteer.device.md) | |
| [ExperimentsConfiguration](./puppeteer.experimentsconfiguration.md) | <p>Defines experiment options for Puppeteer.</p><p>See individual properties for more information.</p> |
| [FrameAddScriptTagOptions](./puppeteer.frameaddscripttagoptions.md) | |
| [FrameAddStyleTagOptions](./puppeteer.frameaddstyletagoptions.md) | |
| [FrameWaitForFunctionOptions](./puppeteer.framewaitforfunctionoptions.md) | |

View File

@ -6,7 +6,7 @@ sidebar_label: Accessibility
The Accessibility class provides methods for inspecting Chromium's accessibility tree. The accessibility tree is used by assistive technology such as [screen readers](https://en.wikipedia.org/wiki/Screen_reader) or [switches](https://en.wikipedia.org/wiki/Switch_access).
**Signature:**
#### Signature:
```typescript
export declare class Accessibility

View File

@ -6,7 +6,7 @@ sidebar_label: Accessibility.snapshot
Captures the current state of the accessibility tree. The returned object represents the root accessible node of the page.
**Signature:**
#### Signature:
```typescript
class Accessibility {

View File

@ -4,7 +4,7 @@ sidebar_label: ActionResult
# ActionResult type
**Signature:**
#### Signature:
```typescript
export declare type ActionResult = 'continue' | 'abort' | 'respond';

View File

@ -4,7 +4,7 @@ sidebar_label: Awaitable
# Awaitable type
**Signature:**
#### Signature:
```typescript
export declare type Awaitable<T> = T | PromiseLike<T>;

View File

@ -6,7 +6,7 @@ sidebar_label: BoundingBox.height
the height of the element in pixels.
**Signature:**
#### Signature:
```typescript
interface BoundingBox {

View File

@ -4,7 +4,7 @@ sidebar_label: BoundingBox
# BoundingBox interface
**Signature:**
#### Signature:
```typescript
export interface BoundingBox extends Point
@ -14,7 +14,7 @@ export interface BoundingBox extends Point
## Properties
| Property | Modifiers | Type | Description |
| ------------------------------------------- | --------- | ------ | ------------------------------------ |
| [height](./puppeteer.boundingbox.height.md) | | number | the height of the element in pixels. |
| [width](./puppeteer.boundingbox.width.md) | | number | the width of the element in pixels. |
| Property | Modifiers | Type | Description | Default |
| ------------------------------------------- | --------- | ------ | ------------------------------------ | ------- |
| [height](./puppeteer.boundingbox.height.md) | | number | the height of the element in pixels. | |
| [width](./puppeteer.boundingbox.width.md) | | number | the width of the element in pixels. | |

View File

@ -6,7 +6,7 @@ sidebar_label: BoundingBox.width
the width of the element in pixels.
**Signature:**
#### Signature:
```typescript
interface BoundingBox {

View File

@ -4,7 +4,7 @@ sidebar_label: BoxModel.border
# BoxModel.border property
**Signature:**
#### Signature:
```typescript
interface BoxModel {

View File

@ -4,7 +4,7 @@ sidebar_label: BoxModel.content
# BoxModel.content property
**Signature:**
#### Signature:
```typescript
interface BoxModel {

View File

@ -4,7 +4,7 @@ sidebar_label: BoxModel.height
# BoxModel.height property
**Signature:**
#### Signature:
```typescript
interface BoxModel {

View File

@ -4,7 +4,7 @@ sidebar_label: BoxModel.margin
# BoxModel.margin property
**Signature:**
#### Signature:
```typescript
interface BoxModel {

View File

@ -4,7 +4,7 @@ sidebar_label: BoxModel
# BoxModel interface
**Signature:**
#### Signature:
```typescript
export interface BoxModel
@ -12,11 +12,11 @@ export interface BoxModel
## Properties
| Property | Modifiers | Type | Description |
| ------------------------------------------ | --------- | --------------------------------- | ----------- |
| [border](./puppeteer.boxmodel.border.md) | | [Point](./puppeteer.point.md)\[\] | |
| [content](./puppeteer.boxmodel.content.md) | | [Point](./puppeteer.point.md)\[\] | |
| [height](./puppeteer.boxmodel.height.md) | | number | |
| [margin](./puppeteer.boxmodel.margin.md) | | [Point](./puppeteer.point.md)\[\] | |
| [padding](./puppeteer.boxmodel.padding.md) | | [Point](./puppeteer.point.md)\[\] | |
| [width](./puppeteer.boxmodel.width.md) | | number | |
| Property | Modifiers | Type | Description | Default |
| ------------------------------------------ | --------- | --------------------------------- | ----------- | ------- |
| [border](./puppeteer.boxmodel.border.md) | | [Point](./puppeteer.point.md)\[\] | | |
| [content](./puppeteer.boxmodel.content.md) | | [Point](./puppeteer.point.md)\[\] | | |
| [height](./puppeteer.boxmodel.height.md) | | number | | |
| [margin](./puppeteer.boxmodel.margin.md) | | [Point](./puppeteer.point.md)\[\] | | |
| [padding](./puppeteer.boxmodel.padding.md) | | [Point](./puppeteer.point.md)\[\] | | |
| [width](./puppeteer.boxmodel.width.md) | | number | | |

View File

@ -4,7 +4,7 @@ sidebar_label: BoxModel.padding
# BoxModel.padding property
**Signature:**
#### Signature:
```typescript
interface BoxModel {

View File

@ -4,7 +4,7 @@ sidebar_label: BoxModel.width
# BoxModel.width property
**Signature:**
#### Signature:
```typescript
interface BoxModel {

View File

@ -6,7 +6,7 @@ sidebar_label: Browser.browserContexts
Returns an array of all open browser contexts. In a newly created browser, this will return a single instance of [BrowserContext](./puppeteer.browsercontext.md).
**Signature:**
#### Signature:
```typescript
class Browser {

View File

@ -6,7 +6,7 @@ sidebar_label: Browser.close
Closes Chromium and all of its pages (if any were opened). The [Browser](./puppeteer.browser.md) object itself is considered to be disposed and cannot be used anymore.
**Signature:**
#### Signature:
```typescript
class Browser {

View File

@ -6,7 +6,7 @@ sidebar_label: Browser.createIncognitoBrowserContext
Creates a new incognito browser context. This won't share cookies/cache with other browser contexts.
**Signature:**
#### Signature:
```typescript
class Browser {

View File

@ -6,7 +6,7 @@ sidebar_label: Browser.defaultBrowserContext
Returns the default browser context. The default browser context cannot be closed.
**Signature:**
#### Signature:
```typescript
class Browser {

View File

@ -6,7 +6,7 @@ sidebar_label: Browser.disconnect
Disconnects Puppeteer from the browser, but leaves the Chromium process running. After calling `disconnect`, the [Browser](./puppeteer.browser.md) object is considered disposed and cannot be used anymore.
**Signature:**
#### Signature:
```typescript
class Browser {

View File

@ -6,7 +6,7 @@ sidebar_label: Browser.isConnected
Indicates that the browser is connected.
**Signature:**
#### Signature:
```typescript
class Browser {

View File

@ -6,7 +6,7 @@ sidebar_label: Browser
A Browser is created when Puppeteer connects to a Chromium instance, either through [PuppeteerNode.launch()](./puppeteer.puppeteernode.launch.md) or [Puppeteer.connect()](./puppeteer.puppeteer.connect.md).
**Signature:**
#### Signature:
```typescript
export declare class Browser extends EventEmitter

View File

@ -6,7 +6,7 @@ sidebar_label: Browser.newPage
Promise which resolves to a new [Page](./puppeteer.page.md) object. The Page is created in a default browser context.
**Signature:**
#### Signature:
```typescript
class Browser {

View File

@ -6,7 +6,7 @@ sidebar_label: Browser.pages
An array of all open pages inside the Browser.
**Signature:**
#### Signature:
```typescript
class Browser {

View File

@ -6,7 +6,7 @@ sidebar_label: Browser.process
The spawned browser process. Returns `null` if the browser instance was created with [Puppeteer.connect()](./puppeteer.puppeteer.connect.md).
**Signature:**
#### Signature:
```typescript
class Browser {

View File

@ -6,7 +6,7 @@ sidebar_label: Browser.target
The target associated with the browser.
**Signature:**
#### Signature:
```typescript
class Browser {

View File

@ -6,7 +6,7 @@ sidebar_label: Browser.targets
All active targets inside the Browser. In case of multiple browser contexts, returns an array with all the targets in all browser contexts.
**Signature:**
#### Signature:
```typescript
class Browser {

View File

@ -6,7 +6,7 @@ sidebar_label: Browser.userAgent
The browser's original user agent. Pages can override the browser user agent with [Page.setUserAgent()](./puppeteer.page.setuseragent.md).
**Signature:**
#### Signature:
```typescript
class Browser {

View File

@ -6,7 +6,7 @@ sidebar_label: Browser.version
A string representing the browser name and version.
**Signature:**
#### Signature:
```typescript
class Browser {

View File

@ -6,7 +6,7 @@ sidebar_label: Browser.waitForTarget
Searches for a target in all browser contexts.
**Signature:**
#### Signature:
```typescript
class Browser {

View File

@ -6,7 +6,7 @@ sidebar_label: Browser.wsEndpoint
The browser websocket endpoint which can be used as an argument to [Puppeteer.connect()](./puppeteer.puppeteer.connect.md).
**Signature:**
#### Signature:
```typescript
class Browser {

View File

@ -6,7 +6,7 @@ sidebar_label: BrowserConnectOptions.defaultViewport
Sets the viewport for each page.
**Signature:**
#### Signature:
```typescript
interface BrowserConnectOptions {

View File

@ -6,10 +6,14 @@ sidebar_label: BrowserConnectOptions.ignoreHTTPSErrors
Whether to ignore HTTPS errors during navigation.
**Signature:**
#### Signature:
```typescript
interface BrowserConnectOptions {
ignoreHTTPSErrors?: boolean;
}
```
#### Default value:
false

View File

@ -6,7 +6,7 @@ sidebar_label: BrowserConnectOptions
Generic browser options that can be passed when launching any browser or when connecting to an existing browser instance.
**Signature:**
#### Signature:
```typescript
export interface BrowserConnectOptions
@ -14,9 +14,9 @@ export interface BrowserConnectOptions
## Properties
| Property | Modifiers | Type | Description |
| ---------------------------------------------------------------------------- | --------- | ----------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
| [defaultViewport?](./puppeteer.browserconnectoptions.defaultviewport.md) | | [Viewport](./puppeteer.viewport.md) \| null | <i>(Optional)</i> Sets the viewport for each page. |
| [ignoreHTTPSErrors?](./puppeteer.browserconnectoptions.ignorehttpserrors.md) | | boolean | <i>(Optional)</i> Whether to ignore HTTPS errors during navigation. |
| [slowMo?](./puppeteer.browserconnectoptions.slowmo.md) | | number | <i>(Optional)</i> Slows down Puppeteer operations by the specified amount of milliseconds to aid debugging. |
| [targetFilter?](./puppeteer.browserconnectoptions.targetfilter.md) | | [TargetFilterCallback](./puppeteer.targetfiltercallback.md) | <i>(Optional)</i> Callback to decide if Puppeteer should connect to a given target or not. |
| Property | Modifiers | Type | Description | Default |
| ---------------------------------------------------------------------------- | --------- | ----------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ------- |
| [defaultViewport?](./puppeteer.browserconnectoptions.defaultviewport.md) | | [Viewport](./puppeteer.viewport.md) \| null | <i>(Optional)</i> Sets the viewport for each page. | |
| [ignoreHTTPSErrors?](./puppeteer.browserconnectoptions.ignorehttpserrors.md) | | boolean | <i>(Optional)</i> Whether to ignore HTTPS errors during navigation. | false |
| [slowMo?](./puppeteer.browserconnectoptions.slowmo.md) | | number | <i>(Optional)</i> Slows down Puppeteer operations by the specified amount of milliseconds to aid debugging. | |
| [targetFilter?](./puppeteer.browserconnectoptions.targetfilter.md) | | [TargetFilterCallback](./puppeteer.targetfiltercallback.md) | <i>(Optional)</i> Callback to decide if Puppeteer should connect to a given target or not. | |

View File

@ -6,7 +6,7 @@ sidebar_label: BrowserConnectOptions.slowMo
Slows down Puppeteer operations by the specified amount of milliseconds to aid debugging.
**Signature:**
#### Signature:
```typescript
interface BrowserConnectOptions {

View File

@ -6,7 +6,7 @@ sidebar_label: BrowserConnectOptions.targetFilter
Callback to decide if Puppeteer should connect to a given target or not.
**Signature:**
#### Signature:
```typescript
interface BrowserConnectOptions {

View File

@ -6,7 +6,7 @@ sidebar_label: BrowserContext.browser
The browser this browser context belongs to.
**Signature:**
#### Signature:
```typescript
class BrowserContext {

View File

@ -6,7 +6,7 @@ sidebar_label: BrowserContext.clearPermissionOverrides
Clears all permission overrides for the browser context.
**Signature:**
#### Signature:
```typescript
class BrowserContext {

View File

@ -6,7 +6,7 @@ sidebar_label: BrowserContext.close
Closes the browser context. All the targets that belong to the browser context will be closed.
**Signature:**
#### Signature:
```typescript
class BrowserContext {

View File

@ -4,7 +4,7 @@ sidebar_label: BrowserContext.id
# BrowserContext.id property
**Signature:**
#### Signature:
```typescript
class BrowserContext {

View File

@ -6,7 +6,7 @@ sidebar_label: BrowserContext.isIncognito
Returns whether BrowserContext is incognito. The default browser context is the only non-incognito browser context.
**Signature:**
#### Signature:
```typescript
class BrowserContext {

View File

@ -6,7 +6,7 @@ sidebar_label: BrowserContext
BrowserContexts provide a way to operate multiple independent browser sessions. When a browser is launched, it has a single BrowserContext used by default. The method [Browser.newPage](./puppeteer.browser.newpage.md) creates a page in the default browser context.
**Signature:**
#### Signature:
```typescript
export declare class BrowserContext extends EventEmitter

View File

@ -6,7 +6,7 @@ sidebar_label: BrowserContext.newPage
Creates a new page in the browser context.
**Signature:**
#### Signature:
```typescript
class BrowserContext {

View File

@ -4,7 +4,7 @@ sidebar_label: BrowserContext.overridePermissions
# BrowserContext.overridePermissions() method
**Signature:**
#### Signature:
```typescript
class BrowserContext {

View File

@ -6,7 +6,7 @@ sidebar_label: BrowserContext.pages
An array of all pages inside the browser context.
**Signature:**
#### Signature:
```typescript
class BrowserContext {

View File

@ -6,7 +6,7 @@ sidebar_label: BrowserContext.targets
An array of all active targets inside the browser context.
**Signature:**
#### Signature:
```typescript
class BrowserContext {

View File

@ -6,7 +6,7 @@ sidebar_label: BrowserContext.waitForTarget
This searches for a target in this specific browser context.
**Signature:**
#### Signature:
```typescript
class BrowserContext {

View File

@ -4,7 +4,7 @@ sidebar_label: BrowserContextEmittedEvents
# BrowserContextEmittedEvents enum
**Signature:**
#### Signature:
```typescript
export declare const enum BrowserContextEmittedEvents

View File

@ -6,7 +6,7 @@ sidebar_label: BrowserContextOptions
BrowserContext options.
**Signature:**
#### Signature:
```typescript
export interface BrowserContextOptions
@ -14,7 +14,7 @@ export interface BrowserContextOptions
## Properties
| Property | Modifiers | Type | Description |
| ------------------------------------------------------------------------ | --------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| [proxyBypassList?](./puppeteer.browsercontextoptions.proxybypasslist.md) | | string\[\] | <i>(Optional)</i> Bypass the proxy for the given list of hosts. |
| [proxyServer?](./puppeteer.browsercontextoptions.proxyserver.md) | | string | <i>(Optional)</i> Proxy server with optional port to use for all requests. Username and password can be set in <code>Page.authenticate</code>. |
| Property | Modifiers | Type | Description | Default |
| ------------------------------------------------------------------------ | --------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
| [proxyBypassList?](./puppeteer.browsercontextoptions.proxybypasslist.md) | | string\[\] | <i>(Optional)</i> Bypass the proxy for the given list of hosts. | |
| [proxyServer?](./puppeteer.browsercontextoptions.proxyserver.md) | | string | <i>(Optional)</i> Proxy server with optional port to use for all requests. Username and password can be set in <code>Page.authenticate</code>. | |

View File

@ -6,7 +6,7 @@ sidebar_label: BrowserContextOptions.proxyBypassList
Bypass the proxy for the given list of hosts.
**Signature:**
#### Signature:
```typescript
interface BrowserContextOptions {

View File

@ -6,7 +6,7 @@ sidebar_label: BrowserContextOptions.proxyServer
Proxy server with optional port to use for all requests. Username and password can be set in `Page.authenticate`.
**Signature:**
#### Signature:
```typescript
interface BrowserContextOptions {

View File

@ -6,7 +6,7 @@ sidebar_label: BrowserEmittedEvents
All the events a [browser instance](./puppeteer.browser.md) may emit.
**Signature:**
#### Signature:
```typescript
export declare const enum BrowserEmittedEvents

View File

@ -6,7 +6,7 @@ sidebar_label: BrowserFetcher.(constructor)
Constructs a browser fetcher for the given options.
**Signature:**
#### Signature:
```typescript
class BrowserFetcher {

View File

@ -6,7 +6,7 @@ sidebar_label: BrowserFetcher.canDownload
Initiates a HEAD request to check if the revision is available.
**Signature:**
#### Signature:
```typescript
class BrowserFetcher {

View File

@ -6,7 +6,7 @@ sidebar_label: BrowserFetcher.download
Initiates a GET request to download the revision from the host.
**Signature:**
#### Signature:
```typescript
class BrowserFetcher {

View File

@ -4,7 +4,7 @@ sidebar_label: BrowserFetcher.host
# BrowserFetcher.host() method
**Signature:**
#### Signature:
```typescript
class BrowserFetcher {

View File

@ -4,7 +4,7 @@ sidebar_label: BrowserFetcher.localRevisions
# BrowserFetcher.localRevisions() method
**Signature:**
#### Signature:
```typescript
class BrowserFetcher {

View File

@ -6,7 +6,7 @@ sidebar_label: BrowserFetcher
BrowserFetcher can download and manage different versions of Chromium and Firefox.
**Signature:**
#### Signature:
```typescript
export declare class BrowserFetcher

View File

@ -4,7 +4,7 @@ sidebar_label: BrowserFetcher.platform
# BrowserFetcher.platform() method
**Signature:**
#### Signature:
```typescript
class BrowserFetcher {

View File

@ -4,7 +4,7 @@ sidebar_label: BrowserFetcher.product
# BrowserFetcher.product() method
**Signature:**
#### Signature:
```typescript
class BrowserFetcher {

View File

@ -4,7 +4,7 @@ sidebar_label: BrowserFetcher.remove
# BrowserFetcher.remove() method
**Signature:**
#### Signature:
```typescript
class BrowserFetcher {

View File

@ -4,7 +4,7 @@ sidebar_label: BrowserFetcher.revisionInfo
# BrowserFetcher.revisionInfo() method
**Signature:**
#### Signature:
```typescript
class BrowserFetcher {

View File

@ -6,10 +6,16 @@ sidebar_label: BrowserFetcherOptions.host
Determines the host that will be used for downloading.
**Signature:**
#### Signature:
```typescript
interface BrowserFetcherOptions {
host?: string;
}
```
#### Default value:
Either
- https://storage.googleapis.com or - https://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central

View File

@ -4,7 +4,7 @@ sidebar_label: BrowserFetcherOptions
# BrowserFetcherOptions interface
**Signature:**
#### Signature:
```typescript
export interface BrowserFetcherOptions
@ -12,10 +12,10 @@ export interface BrowserFetcherOptions
## Properties
| Property | Modifiers | Type | Description |
| ---------------------------------------------------------------------------- | --------- | ----------------------------------- | ------------------------------------------------------------------------------------------------------ |
| [host?](./puppeteer.browserfetcheroptions.host.md) | | string | <i>(Optional)</i> Determines the host that will be used for downloading. |
| [path](./puppeteer.browserfetcheroptions.path.md) | | string | Determines the path to download browsers to. |
| [platform?](./puppeteer.browserfetcheroptions.platform.md) | | [Platform](./puppeteer.platform.md) | <i>(Optional)</i> Determines which platform the browser will be suited for. |
| [product?](./puppeteer.browserfetcheroptions.product.md) | | 'chrome' \| 'firefox' | <i>(Optional)</i> Determines which product the [BrowserFetcher](./puppeteer.browserfetcher.md) is for. |
| [useMacOSARMBinary?](./puppeteer.browserfetcheroptions.usemacosarmbinary.md) | | boolean | <i>(Optional)</i> Enables the use of the Chromium binary for macOS ARM. |
| Property | Modifiers | Type | Description | Default |
| ---------------------------------------------------------------------------- | --------- | ----------------------------------- | ------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------- |
| [host?](./puppeteer.browserfetcheroptions.host.md) | | string | <i>(Optional)</i> Determines the host that will be used for downloading. | <p>Either</p><p>- https://storage.googleapis.com or - https://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central</p> |
| [path](./puppeteer.browserfetcheroptions.path.md) | | string | Determines the path to download browsers to. | |
| [platform?](./puppeteer.browserfetcheroptions.platform.md) | | [Platform](./puppeteer.platform.md) | <i>(Optional)</i> Determines which platform the browser will be suited for. | Auto-detected. |
| [product?](./puppeteer.browserfetcheroptions.product.md) | | 'chrome' \| 'firefox' | <i>(Optional)</i> Determines which product the [BrowserFetcher](./puppeteer.browserfetcher.md) is for. | <code>&quot;chrome&quot;</code>. |
| [useMacOSARMBinary?](./puppeteer.browserfetcheroptions.usemacosarmbinary.md) | | boolean | <i>(Optional)</i> Enables the use of the Chromium binary for macOS ARM. | |

View File

@ -6,7 +6,7 @@ sidebar_label: BrowserFetcherOptions.path
Determines the path to download browsers to.
**Signature:**
#### Signature:
```typescript
interface BrowserFetcherOptions {

View File

@ -6,10 +6,14 @@ sidebar_label: BrowserFetcherOptions.platform
Determines which platform the browser will be suited for.
**Signature:**
#### Signature:
```typescript
interface BrowserFetcherOptions {
platform?: Platform;
}
```
#### Default value:
Auto-detected.

View File

@ -6,10 +6,14 @@ sidebar_label: BrowserFetcherOptions.product
Determines which product the [BrowserFetcher](./puppeteer.browserfetcher.md) is for.
**Signature:**
#### Signature:
```typescript
interface BrowserFetcherOptions {
product?: 'chrome' | 'firefox';
}
```
#### Default value:
`"chrome"`.

View File

@ -6,7 +6,7 @@ sidebar_label: BrowserFetcherOptions.useMacOSARMBinary
Enables the use of the Chromium binary for macOS ARM.
**Signature:**
#### Signature:
```typescript
interface BrowserFetcherOptions {

View File

@ -4,7 +4,7 @@ sidebar_label: BrowserFetcherRevisionInfo.executablePath
# BrowserFetcherRevisionInfo.executablePath property
**Signature:**
#### Signature:
```typescript
interface BrowserFetcherRevisionInfo {

View File

@ -4,7 +4,7 @@ sidebar_label: BrowserFetcherRevisionInfo.folderPath
# BrowserFetcherRevisionInfo.folderPath property
**Signature:**
#### Signature:
```typescript
interface BrowserFetcherRevisionInfo {

View File

@ -4,7 +4,7 @@ sidebar_label: BrowserFetcherRevisionInfo.local
# BrowserFetcherRevisionInfo.local property
**Signature:**
#### Signature:
```typescript
interface BrowserFetcherRevisionInfo {

View File

@ -4,7 +4,7 @@ sidebar_label: BrowserFetcherRevisionInfo
# BrowserFetcherRevisionInfo interface
**Signature:**
#### Signature:
```typescript
export interface BrowserFetcherRevisionInfo
@ -12,11 +12,11 @@ export interface BrowserFetcherRevisionInfo
## Properties
| Property | Modifiers | Type | Description |
| -------------------------------------------------------------------------- | --------- | ------- | ----------- |
| [executablePath](./puppeteer.browserfetcherrevisioninfo.executablepath.md) | | string | |
| [folderPath](./puppeteer.browserfetcherrevisioninfo.folderpath.md) | | string | |
| [local](./puppeteer.browserfetcherrevisioninfo.local.md) | | boolean | |
| [product](./puppeteer.browserfetcherrevisioninfo.product.md) | | string | |
| [revision](./puppeteer.browserfetcherrevisioninfo.revision.md) | | string | |
| [url](./puppeteer.browserfetcherrevisioninfo.url.md) | | string | |
| Property | Modifiers | Type | Description | Default |
| -------------------------------------------------------------------------- | --------- | ------- | ----------- | ------- |
| [executablePath](./puppeteer.browserfetcherrevisioninfo.executablepath.md) | | string | | |
| [folderPath](./puppeteer.browserfetcherrevisioninfo.folderpath.md) | | string | | |
| [local](./puppeteer.browserfetcherrevisioninfo.local.md) | | boolean | | |
| [product](./puppeteer.browserfetcherrevisioninfo.product.md) | | string | | |
| [revision](./puppeteer.browserfetcherrevisioninfo.revision.md) | | string | | |
| [url](./puppeteer.browserfetcherrevisioninfo.url.md) | | string | | |

View File

@ -4,7 +4,7 @@ sidebar_label: BrowserFetcherRevisionInfo.product
# BrowserFetcherRevisionInfo.product property
**Signature:**
#### Signature:
```typescript
interface BrowserFetcherRevisionInfo {

View File

@ -4,7 +4,7 @@ sidebar_label: BrowserFetcherRevisionInfo.revision
# BrowserFetcherRevisionInfo.revision property
**Signature:**
#### Signature:
```typescript
interface BrowserFetcherRevisionInfo {

View File

@ -4,7 +4,7 @@ sidebar_label: BrowserFetcherRevisionInfo.url
# BrowserFetcherRevisionInfo.url property
**Signature:**
#### Signature:
```typescript
interface BrowserFetcherRevisionInfo {

View File

@ -6,7 +6,7 @@ sidebar_label: BrowserLaunchArgumentOptions.args
Additional command line arguments to pass to the browser instance.
**Signature:**
#### Signature:
```typescript
interface BrowserLaunchArgumentOptions {

View File

@ -4,7 +4,7 @@ sidebar_label: BrowserLaunchArgumentOptions.debuggingPort
# BrowserLaunchArgumentOptions.debuggingPort property
**Signature:**
#### Signature:
```typescript
interface BrowserLaunchArgumentOptions {

View File

@ -6,10 +6,14 @@ sidebar_label: BrowserLaunchArgumentOptions.devtools
Whether to auto-open a DevTools panel for each tab. If this is set to `true`, then `headless` will be forced to `false`.
**Signature:**
#### Signature:
```typescript
interface BrowserLaunchArgumentOptions {
devtools?: boolean;
}
```
#### Default value:
`false`

View File

@ -6,10 +6,14 @@ sidebar_label: BrowserLaunchArgumentOptions.headless
Whether to run the browser in headless mode.
**Signature:**
#### Signature:
```typescript
interface BrowserLaunchArgumentOptions {
headless?: boolean | 'chrome';
}
```
#### Default value:
true

View File

@ -6,7 +6,7 @@ sidebar_label: BrowserLaunchArgumentOptions
Launcher options that only apply to Chrome.
**Signature:**
#### Signature:
```typescript
export interface BrowserLaunchArgumentOptions
@ -14,10 +14,10 @@ export interface BrowserLaunchArgumentOptions
## Properties
| Property | Modifiers | Type | Description |
| --------------------------------------------------------------------------- | --------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [args?](./puppeteer.browserlaunchargumentoptions.args.md) | | string\[\] | <i>(Optional)</i> Additional command line arguments to pass to the browser instance. |
| [debuggingPort?](./puppeteer.browserlaunchargumentoptions.debuggingport.md) | | number | <i>(Optional)</i> |
| [devtools?](./puppeteer.browserlaunchargumentoptions.devtools.md) | | boolean | <i>(Optional)</i> Whether to auto-open a DevTools panel for each tab. If this is set to <code>true</code>, then <code>headless</code> will be forced to <code>false</code>. |
| [headless?](./puppeteer.browserlaunchargumentoptions.headless.md) | | boolean \| 'chrome' | <i>(Optional)</i> Whether to run the browser in headless mode. |
| [userDataDir?](./puppeteer.browserlaunchargumentoptions.userdatadir.md) | | string | <i>(Optional)</i> Path to a user data directory. [see the Chromium docs](https://chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/user_data_dir.md) for more info. |
| Property | Modifiers | Type | Description | Default |
| --------------------------------------------------------------------------- | --------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ |
| [args?](./puppeteer.browserlaunchargumentoptions.args.md) | | string\[\] | <i>(Optional)</i> Additional command line arguments to pass to the browser instance. | |
| [debuggingPort?](./puppeteer.browserlaunchargumentoptions.debuggingport.md) | | number | <i>(Optional)</i> | |
| [devtools?](./puppeteer.browserlaunchargumentoptions.devtools.md) | | boolean | <i>(Optional)</i> Whether to auto-open a DevTools panel for each tab. If this is set to <code>true</code>, then <code>headless</code> will be forced to <code>false</code>. | <code>false</code> |
| [headless?](./puppeteer.browserlaunchargumentoptions.headless.md) | | boolean \| 'chrome' | <i>(Optional)</i> Whether to run the browser in headless mode. | true |
| [userDataDir?](./puppeteer.browserlaunchargumentoptions.userdatadir.md) | | string | <i>(Optional)</i> Path to a user data directory. [see the Chromium docs](https://chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/user_data_dir.md) for more info. | |

View File

@ -6,7 +6,7 @@ sidebar_label: BrowserLaunchArgumentOptions.userDataDir
Path to a user data directory. [see the Chromium docs](https://chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/user_data_dir.md) for more info.
**Signature:**
#### Signature:
```typescript
interface BrowserLaunchArgumentOptions {

View File

@ -4,7 +4,7 @@ sidebar_label: CDPSession.connection
# CDPSession.connection() method
**Signature:**
#### Signature:
```typescript
class CDPSession {

View File

@ -6,7 +6,7 @@ sidebar_label: CDPSession.detach
Detaches the cdpSession from the target. Once detached, the cdpSession object won't emit any events and can't be used to send messages.
**Signature:**
#### Signature:
```typescript
class CDPSession {

View File

@ -6,7 +6,7 @@ sidebar_label: CDPSession.id
Returns the session's id.
**Signature:**
#### Signature:
```typescript
class CDPSession {

View File

@ -6,7 +6,7 @@ sidebar_label: CDPSession
The `CDPSession` instances are used to talk raw Chrome Devtools Protocol.
**Signature:**
#### Signature:
```typescript
export declare class CDPSession extends EventEmitter

View File

@ -4,7 +4,7 @@ sidebar_label: CDPSession.send
# CDPSession.send() method
**Signature:**
#### Signature:
```typescript
class CDPSession {

View File

@ -4,7 +4,7 @@ sidebar_label: CDPSessionOnMessageObject.error
# CDPSessionOnMessageObject.error property
**Signature:**
#### Signature:
```typescript
interface CDPSessionOnMessageObject {

View File

@ -4,7 +4,7 @@ sidebar_label: CDPSessionOnMessageObject.id
# CDPSessionOnMessageObject.id property
**Signature:**
#### Signature:
```typescript
interface CDPSessionOnMessageObject {

View File

@ -4,7 +4,7 @@ sidebar_label: CDPSessionOnMessageObject
# CDPSessionOnMessageObject interface
**Signature:**
#### Signature:
```typescript
export interface CDPSessionOnMessageObject
@ -12,10 +12,10 @@ export interface CDPSessionOnMessageObject
## Properties
| Property | Modifiers | Type | Description |
| ---------------------------------------------------------- | --------- | --------------------------------------------- | ----------------- |
| [error](./puppeteer.cdpsessiononmessageobject.error.md) | | { message: string; data: any; code: number; } | |
| [id?](./puppeteer.cdpsessiononmessageobject.id.md) | | number | <i>(Optional)</i> |
| [method](./puppeteer.cdpsessiononmessageobject.method.md) | | string | |
| [params](./puppeteer.cdpsessiononmessageobject.params.md) | | Record&lt;string, unknown&gt; | |
| [result?](./puppeteer.cdpsessiononmessageobject.result.md) | | any | <i>(Optional)</i> |
| Property | Modifiers | Type | Description | Default |
| ---------------------------------------------------------- | --------- | --------------------------------------------- | ----------------- | ------- |
| [error](./puppeteer.cdpsessiononmessageobject.error.md) | | { message: string; data: any; code: number; } | | |
| [id?](./puppeteer.cdpsessiononmessageobject.id.md) | | number | <i>(Optional)</i> | |
| [method](./puppeteer.cdpsessiononmessageobject.method.md) | | string | | |
| [params](./puppeteer.cdpsessiononmessageobject.params.md) | | Record&lt;string, unknown&gt; | | |
| [result?](./puppeteer.cdpsessiononmessageobject.result.md) | | any | <i>(Optional)</i> | |

View File

@ -4,7 +4,7 @@ sidebar_label: CDPSessionOnMessageObject.method
# CDPSessionOnMessageObject.method property
**Signature:**
#### Signature:
```typescript
interface CDPSessionOnMessageObject {

View File

@ -4,7 +4,7 @@ sidebar_label: CDPSessionOnMessageObject.params
# CDPSessionOnMessageObject.params property
**Signature:**
#### Signature:
```typescript
interface CDPSessionOnMessageObject {

View File

@ -4,7 +4,7 @@ sidebar_label: CDPSessionOnMessageObject.result
# CDPSessionOnMessageObject.result property
**Signature:**
#### Signature:
```typescript
interface CDPSessionOnMessageObject {

View File

@ -4,7 +4,7 @@ sidebar_label: ChromeReleaseChannel
# ChromeReleaseChannel type
**Signature:**
#### Signature:
```typescript
export declare type ChromeReleaseChannel =

View File

@ -8,7 +8,7 @@ sidebar_label: clearCustomQueryHandlers
>
> Import [Puppeteer](./puppeteer.puppeteer.md) and use the static method [Puppeteer.clearCustomQueryHandlers()](./puppeteer.puppeteer.clearcustomqueryhandlers.md)
**Signature:**
#### Signature:
```typescript
export declare function clearCustomQueryHandlers(): void;

View File

@ -4,10 +4,14 @@ sidebar_label: ClickOptions.button
# ClickOptions.button property
**Signature:**
#### Signature:
```typescript
interface ClickOptions {
button?: MouseButton;
}
```
#### Default value:
'left'

View File

@ -4,10 +4,14 @@ sidebar_label: ClickOptions.clickCount
# ClickOptions.clickCount property
**Signature:**
#### Signature:
```typescript
interface ClickOptions {
clickCount?: number;
}
```
#### Default value:
1

View File

@ -6,10 +6,14 @@ sidebar_label: ClickOptions.delay
Time to wait between `mousedown` and `mouseup` in milliseconds.
**Signature:**
#### Signature:
```typescript
interface ClickOptions {
delay?: number;
}
```
#### Default value:
0

View File

@ -4,7 +4,7 @@ sidebar_label: ClickOptions
# ClickOptions interface
**Signature:**
#### Signature:
```typescript
export interface ClickOptions
@ -12,9 +12,9 @@ export interface ClickOptions
## Properties
| Property | Modifiers | Type | Description |
| ----------------------------------------------------- | --------- | ----------------------------------------- | ------------------------------------------------------------------------------------------------------- |
| [button?](./puppeteer.clickoptions.button.md) | | [MouseButton](./puppeteer.mousebutton.md) | <i>(Optional)</i> |
| [clickCount?](./puppeteer.clickoptions.clickcount.md) | | number | <i>(Optional)</i> |
| [delay?](./puppeteer.clickoptions.delay.md) | | number | <i>(Optional)</i> Time to wait between <code>mousedown</code> and <code>mouseup</code> in milliseconds. |
| [offset?](./puppeteer.clickoptions.offset.md) | | [Offset](./puppeteer.offset.md) | <i>(Optional)</i> Offset for the clickable point relative to the top-left corner of the border box. |
| Property | Modifiers | Type | Description | Default |
| ----------------------------------------------------- | --------- | ----------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------- |
| [button?](./puppeteer.clickoptions.button.md) | | [MouseButton](./puppeteer.mousebutton.md) | <i>(Optional)</i> | 'left' |
| [clickCount?](./puppeteer.clickoptions.clickcount.md) | | number | <i>(Optional)</i> | 1 |
| [delay?](./puppeteer.clickoptions.delay.md) | | number | <i>(Optional)</i> Time to wait between <code>mousedown</code> and <code>mouseup</code> in milliseconds. | 0 |
| [offset?](./puppeteer.clickoptions.offset.md) | | [Offset](./puppeteer.offset.md) | <i>(Optional)</i> Offset for the clickable point relative to the top-left corner of the border box. | |

View File

@ -6,7 +6,7 @@ sidebar_label: ClickOptions.offset
Offset for the clickable point relative to the top-left corner of the border box.
**Signature:**
#### Signature:
```typescript
interface ClickOptions {

Some files were not shown because too many files have changed in this diff Show More