chore(docs): generate site for v10.0.0

* fix: added parts of website

* fix: removed unnecessary lines

* fix: updated contributing.md

* fix: added parts of sidebar

* fix: added all APIs

* fix: added version 10.0.0

Co-authored-by: Jack Franklin <jacktfranklin@chromium.org>
This commit is contained in:
TASNEEM KOUSHAR 2021-08-09 14:27:14 +05:30 committed by GitHub
parent 3cfacee850
commit 34ff00e2fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
709 changed files with 16903 additions and 2 deletions

View File

@ -201,7 +201,9 @@ export interface ScreenshotOptions {
* @public * @public
*/ */
export const enum PageEmittedEvents { export const enum PageEmittedEvents {
/** Emitted when the page closes. */ /** Emitted when the page closes.
* @eventProperty
*/
Close = 'close', Close = 'close',
/** /**
* Emitted when JavaScript within the page calls one of console API methods, * Emitted when JavaScript within the page calls one of console API methods,

View File

@ -22,7 +22,7 @@ module.exports = {
tagline: 'Note: this documentation is WIP. Please use https://pptr.dev.', tagline: 'Note: this documentation is WIP. Please use https://pptr.dev.',
url: 'https://puppeteer.github.io/', url: 'https://puppeteer.github.io/',
baseUrl: '/puppeteer/', baseUrl: '/puppeteer/',
onBrokenLinks: 'ignore', onBrokenLinks: 'warn',
onBrokenMarkdownLinks: 'ignore', onBrokenMarkdownLinks: 'ignore',
favicon: 'img/favicon.ico', favicon: 'img/favicon.ico',
organizationName: 'puppeteer', // Usually your GitHub org/user name. organizationName: 'puppeteer', // Usually your GitHub org/user name.
@ -48,6 +48,9 @@ module.exports = {
label: 'Contribute', label: 'Contribute',
position: 'left', position: 'left',
}, },
{
type: 'docsVersionDropdown',
},
{ {
label: 'Github', label: 'Github',
href: 'https://github.com/puppeteer/puppeteer', href: 'https://github.com/puppeteer/puppeteer',

View File

@ -471,6 +471,11 @@ module.exports = {
id: 'puppeteer.page.metrics', id: 'puppeteer.page.metrics',
label: 'metrics', label: 'metrics',
}, },
{
type: 'doc',
id: 'puppeteer.page.once',
label: 'once',
},
{ {
type: 'doc', type: 'doc',
id: 'puppeteer.page.pdf', id: 'puppeteer.page.pdf',

View File

@ -0,0 +1,12 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md)
## API Reference
## Packages
| Package | Description |
| --- | --- |
| [puppeteer](./puppeteer.md) | |

View File

@ -0,0 +1,30 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [Accessibility](./puppeteer.accessibility.md)
## Accessibility class
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).
<b>Signature:</b>
```typescript
export declare class Accessibility
```
## Remarks
Accessibility is a very platform-specific thing. On different platforms, there are different screen readers that might have wildly different output.
Blink - Chrome's rendering engine - has a concept of "accessibility tree", which is then translated into different platform-specific APIs. Accessibility namespace gives users access to the Blink Accessibility Tree.
Most of the accessibility tree gets filtered out when converting from Blink AX Tree to Platform-specific AX-Tree or by assistive technologies themselves. By default, Puppeteer tries to approximate this filtering, exposing only the "interesting" nodes of the tree.
The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `Accessibility` class.
## Methods
| Method | Modifiers | Description |
| --- | --- | --- |
| [snapshot(options)](./puppeteer.accessibility.snapshot.md) | | Captures the current state of the accessibility tree. The returned object represents the root accessible node of the page. |

View File

@ -0,0 +1,61 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [Accessibility](./puppeteer.accessibility.md) &gt; [snapshot](./puppeteer.accessibility.snapshot.md)
## Accessibility.snapshot() method
Captures the current state of the accessibility tree. The returned object represents the root accessible node of the page.
<b>Signature:</b>
```typescript
snapshot(options?: SnapshotOptions): Promise<SerializedAXNode>;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| options | [SnapshotOptions](./puppeteer.snapshotoptions.md) | |
<b>Returns:</b>
Promise&lt;[SerializedAXNode](./puppeteer.serializedaxnode.md)&gt;
An AXNode object representing the snapshot.
## Remarks
\*\*NOTE\*\* The Chromium accessibility tree contains nodes that go unused on most platforms and by most screen readers. Puppeteer will discard them as well for an easier to process tree, unless `interestingOnly` is set to `false`.
## Example 1
An example of dumping the entire accessibility tree:
```js
const snapshot = await page.accessibility.snapshot();
console.log(snapshot);
```
## Example 2
An example of logging the focused node's name:
```js
const snapshot = await page.accessibility.snapshot();
const node = findFocusedNode(snapshot);
console.log(node && node.name);
function findFocusedNode(node) {
if (node.focused)
return node;
for (const child of node.children || []) {
const foundNode = findFocusedNode(child);
return foundNode;
}
return null;
}
```

View File

@ -0,0 +1,12 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [ActionResult](./puppeteer.actionresult.md)
## ActionResult type
<b>Signature:</b>
```typescript
export declare type ActionResult = 'continue' | 'abort' | 'respond';
```

View File

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [BoundingBox](./puppeteer.boundingbox.md) &gt; [height](./puppeteer.boundingbox.height.md)
## BoundingBox.height property
the height of the element in pixels.
<b>Signature:</b>
```typescript
height: number;
```

View File

@ -0,0 +1,22 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [BoundingBox](./puppeteer.boundingbox.md)
## BoundingBox interface
<b>Signature:</b>
```typescript
export interface BoundingBox
```
## Properties
| Property | 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. |
| [x](./puppeteer.boundingbox.x.md) | number | the x coordinate of the element in pixels. |
| [y](./puppeteer.boundingbox.y.md) | number | the y coordinate of the element in pixels. |

View File

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [BoundingBox](./puppeteer.boundingbox.md) &gt; [width](./puppeteer.boundingbox.width.md)
## BoundingBox.width property
the width of the element in pixels.
<b>Signature:</b>
```typescript
width: number;
```

View File

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [BoundingBox](./puppeteer.boundingbox.md) &gt; [x](./puppeteer.boundingbox.x.md)
## BoundingBox.x property
the x coordinate of the element in pixels.
<b>Signature:</b>
```typescript
x: number;
```

View File

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [BoundingBox](./puppeteer.boundingbox.md) &gt; [y](./puppeteer.boundingbox.y.md)
## BoundingBox.y property
the y coordinate of the element in pixels.
<b>Signature:</b>
```typescript
y: number;
```

View File

@ -0,0 +1,14 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [BoxModel](./puppeteer.boxmodel.md) &gt; [border](./puppeteer.boxmodel.border.md)
## BoxModel.border property
<b>Signature:</b>
```typescript
border: Array<{
x: number;
y: number;
}>;
```

View File

@ -0,0 +1,14 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [BoxModel](./puppeteer.boxmodel.md) &gt; [content](./puppeteer.boxmodel.content.md)
## BoxModel.content property
<b>Signature:</b>
```typescript
content: Array<{
x: number;
y: number;
}>;
```

View File

@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [BoxModel](./puppeteer.boxmodel.md) &gt; [height](./puppeteer.boxmodel.height.md)
## BoxModel.height property
<b>Signature:</b>
```typescript
height: number;
```

View File

@ -0,0 +1,14 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [BoxModel](./puppeteer.boxmodel.md) &gt; [margin](./puppeteer.boxmodel.margin.md)
## BoxModel.margin property
<b>Signature:</b>
```typescript
margin: Array<{
x: number;
y: number;
}>;
```

View File

@ -0,0 +1,24 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [BoxModel](./puppeteer.boxmodel.md)
## BoxModel interface
<b>Signature:</b>
```typescript
export interface BoxModel
```
## Properties
| Property | Type | Description |
| --- | --- | --- |
| [border](./puppeteer.boxmodel.border.md) | Array&lt;{ x: number; y: number; }&gt; | |
| [content](./puppeteer.boxmodel.content.md) | Array&lt;{ x: number; y: number; }&gt; | |
| [height](./puppeteer.boxmodel.height.md) | number | |
| [margin](./puppeteer.boxmodel.margin.md) | Array&lt;{ x: number; y: number; }&gt; | |
| [padding](./puppeteer.boxmodel.padding.md) | Array&lt;{ x: number; y: number; }&gt; | |
| [width](./puppeteer.boxmodel.width.md) | number | |

View File

@ -0,0 +1,14 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [BoxModel](./puppeteer.boxmodel.md) &gt; [padding](./puppeteer.boxmodel.padding.md)
## BoxModel.padding property
<b>Signature:</b>
```typescript
padding: Array<{
x: number;
y: number;
}>;
```

View File

@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [BoxModel](./puppeteer.boxmodel.md) &gt; [width](./puppeteer.boxmodel.width.md)
## BoxModel.width property
<b>Signature:</b>
```typescript
width: number;
```

View File

@ -0,0 +1,17 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [Browser](./puppeteer.browser.md) &gt; [browserContexts](./puppeteer.browser.browsercontexts.md)
## Browser.browserContexts() method
Returns an array of all open browser contexts. In a newly created browser, this will return a single instance of [BrowserContext](./puppeteer.browsercontext.md).
<b>Signature:</b>
```typescript
browserContexts(): BrowserContext[];
```
<b>Returns:</b>
[BrowserContext](./puppeteer.browsercontext.md)\[\]

View File

@ -0,0 +1,17 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [Browser](./puppeteer.browser.md) &gt; [close](./puppeteer.browser.close.md)
## Browser.close() method
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.
<b>Signature:</b>
```typescript
close(): Promise<void>;
```
<b>Returns:</b>
Promise&lt;void&gt;

View File

@ -0,0 +1,33 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [Browser](./puppeteer.browser.md) &gt; [createIncognitoBrowserContext](./puppeteer.browser.createincognitobrowsercontext.md)
## Browser.createIncognitoBrowserContext() method
Creates a new incognito browser context. This won't share cookies/cache with other browser contexts.
<b>Signature:</b>
```typescript
createIncognitoBrowserContext(): Promise<BrowserContext>;
```
<b>Returns:</b>
Promise&lt;[BrowserContext](./puppeteer.browsercontext.md)&gt;
## Example
```js
(async () => {
const browser = await puppeteer.launch();
// Create a new incognito browser context.
const context = await browser.createIncognitoBrowserContext();
// Create a new page in a pristine context.
const page = await context.newPage();
// Do stuff
await page.goto('https://example.com');
})();
```

View File

@ -0,0 +1,17 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [Browser](./puppeteer.browser.md) &gt; [defaultBrowserContext](./puppeteer.browser.defaultbrowsercontext.md)
## Browser.defaultBrowserContext() method
Returns the default browser context. The default browser context cannot be closed.
<b>Signature:</b>
```typescript
defaultBrowserContext(): BrowserContext;
```
<b>Returns:</b>
[BrowserContext](./puppeteer.browsercontext.md)

View File

@ -0,0 +1,17 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [Browser](./puppeteer.browser.md) &gt; [disconnect](./puppeteer.browser.disconnect.md)
## Browser.disconnect() method
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.
<b>Signature:</b>
```typescript
disconnect(): void;
```
<b>Returns:</b>
void

View File

@ -0,0 +1,17 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [Browser](./puppeteer.browser.md) &gt; [isConnected](./puppeteer.browser.isconnected.md)
## Browser.isConnected() method
Indicates that the browser is connected.
<b>Signature:</b>
```typescript
isConnected(): boolean;
```
<b>Returns:</b>
boolean

View File

@ -0,0 +1,79 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [Browser](./puppeteer.browser.md)
## Browser class
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).
<b>Signature:</b>
```typescript
export declare class Browser extends EventEmitter
```
<b>Extends:</b> [EventEmitter](./puppeteer.eventemitter.md)
## Remarks
The Browser class extends from Puppeteer's [EventEmitter](./puppeteer.eventemitter.md) class and will emit various events which are documented in the [BrowserEmittedEvents](./puppeteer.browseremittedevents.md) enum.
The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `Browser` class.
## Example 1
An example of using a [Browser](./puppeteer.browser.md) to create a [Page](./puppeteer.page.md):
```js
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto('https://example.com');
await browser.close();
})();
```
## Example 2
An example of disconnecting from and reconnecting to a [Browser](./puppeteer.browser.md):
```js
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch();
// Store the endpoint to be able to reconnect to Chromium
const browserWSEndpoint = browser.wsEndpoint();
// Disconnect puppeteer from Chromium
browser.disconnect();
// Use the endpoint to reestablish a connection
const browser2 = await puppeteer.connect({browserWSEndpoint});
// Close Chromium
await browser2.close();
})();
```
## Methods
| Method | Modifiers | Description |
| --- | --- | --- |
| [browserContexts()](./puppeteer.browser.browsercontexts.md) | | Returns an array of all open browser contexts. In a newly created browser, this will return a single instance of [BrowserContext](./puppeteer.browsercontext.md). |
| [close()](./puppeteer.browser.close.md) | | 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. |
| [createIncognitoBrowserContext()](./puppeteer.browser.createincognitobrowsercontext.md) | | Creates a new incognito browser context. This won't share cookies/cache with other browser contexts. |
| [defaultBrowserContext()](./puppeteer.browser.defaultbrowsercontext.md) | | Returns the default browser context. The default browser context cannot be closed. |
| [disconnect()](./puppeteer.browser.disconnect.md) | | Disconnects Puppeteer from the browser, but leaves the Chromium process running. After calling <code>disconnect</code>, the [Browser](./puppeteer.browser.md) object is considered disposed and cannot be used anymore. |
| [isConnected()](./puppeteer.browser.isconnected.md) | | Indicates that the browser is connected. |
| [newPage()](./puppeteer.browser.newpage.md) | | Promise which resolves to a new [Page](./puppeteer.page.md) object. The Page is created in a default browser context. |
| [pages()](./puppeteer.browser.pages.md) | | An array of all open pages inside the Browser. |
| [process()](./puppeteer.browser.process.md) | | The spawned browser process. Returns <code>null</code> if the browser instance was created with [Puppeteer.connect()](./puppeteer.puppeteer.connect.md). |
| [target()](./puppeteer.browser.target.md) | | The target associated with the browser. |
| [targets()](./puppeteer.browser.targets.md) | | All active targets inside the Browser. In case of multiple browser contexts, returns an array with all the targets in all browser contexts. |
| [userAgent()](./puppeteer.browser.useragent.md) | | The browser's original user agent. Pages can override the browser user agent with [Page.setUserAgent()](./puppeteer.page.setuseragent.md). |
| [version()](./puppeteer.browser.version.md) | | A string representing the browser name and version. |
| [waitForTarget(predicate, options)](./puppeteer.browser.waitfortarget.md) | | Searches for a target in all browser contexts. |
| [wsEndpoint()](./puppeteer.browser.wsendpoint.md) | | The browser websocket endpoint which can be used as an argument to [Puppeteer.connect()](./puppeteer.puppeteer.connect.md). |

View File

@ -0,0 +1,17 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [Browser](./puppeteer.browser.md) &gt; [newPage](./puppeteer.browser.newpage.md)
## Browser.newPage() method
Promise which resolves to a new [Page](./puppeteer.page.md) object. The Page is created in a default browser context.
<b>Signature:</b>
```typescript
newPage(): Promise<Page>;
```
<b>Returns:</b>
Promise&lt;[Page](./puppeteer.page.md)&gt;

View File

@ -0,0 +1,21 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [Browser](./puppeteer.browser.md) &gt; [pages](./puppeteer.browser.pages.md)
## Browser.pages() method
An array of all open pages inside the Browser.
<b>Signature:</b>
```typescript
pages(): Promise<Page[]>;
```
<b>Returns:</b>
Promise&lt;[Page](./puppeteer.page.md)\[\]&gt;
## Remarks
In case of multiple browser contexts, returns an array with all the pages in all browser contexts. Non-visible pages, such as `"background_page"`, will not be listed here. You can find them using [Target.page()](./puppeteer.target.page.md).

View File

@ -0,0 +1,17 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [Browser](./puppeteer.browser.md) &gt; [process](./puppeteer.browser.process.md)
## Browser.process() method
The spawned browser process. Returns `null` if the browser instance was created with [Puppeteer.connect()](./puppeteer.puppeteer.connect.md).
<b>Signature:</b>
```typescript
process(): ChildProcess | null;
```
<b>Returns:</b>
ChildProcess \| null

View File

@ -0,0 +1,17 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [Browser](./puppeteer.browser.md) &gt; [target](./puppeteer.browser.target.md)
## Browser.target() method
The target associated with the browser.
<b>Signature:</b>
```typescript
target(): Target;
```
<b>Returns:</b>
[Target](./puppeteer.target.md)

View File

@ -0,0 +1,17 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [Browser](./puppeteer.browser.md) &gt; [targets](./puppeteer.browser.targets.md)
## Browser.targets() method
All active targets inside the Browser. In case of multiple browser contexts, returns an array with all the targets in all browser contexts.
<b>Signature:</b>
```typescript
targets(): Target[];
```
<b>Returns:</b>
[Target](./puppeteer.target.md)\[\]

View File

@ -0,0 +1,17 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [Browser](./puppeteer.browser.md) &gt; [userAgent](./puppeteer.browser.useragent.md)
## Browser.userAgent() method
The browser's original user agent. Pages can override the browser user agent with [Page.setUserAgent()](./puppeteer.page.setuseragent.md).
<b>Signature:</b>
```typescript
userAgent(): Promise<string>;
```
<b>Returns:</b>
Promise&lt;string&gt;

View File

@ -0,0 +1,23 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [Browser](./puppeteer.browser.md) &gt; [version](./puppeteer.browser.version.md)
## Browser.version() method
A string representing the browser name and version.
<b>Signature:</b>
```typescript
version(): Promise<string>;
```
<b>Returns:</b>
Promise&lt;string&gt;
## Remarks
For headless Chromium, this is similar to `HeadlessChrome/61.0.3153.0`. For non-headless, this is similar to `Chrome/61.0.3153.0`.
The format of browser.version() might change with future releases of Chromium.

View File

@ -0,0 +1,37 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [Browser](./puppeteer.browser.md) &gt; [waitForTarget](./puppeteer.browser.waitfortarget.md)
## Browser.waitForTarget() method
Searches for a target in all browser contexts.
<b>Signature:</b>
```typescript
waitForTarget(predicate: (x: Target) => boolean, options?: WaitForTargetOptions): Promise<Target>;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| predicate | (x: [Target](./puppeteer.target.md)) =&gt; boolean | A function to be run for every target. |
| options | [WaitForTargetOptions](./puppeteer.waitfortargetoptions.md) | |
<b>Returns:</b>
Promise&lt;[Target](./puppeteer.target.md)&gt;
The first target found that matches the `predicate` function.
## Example
An example of finding a target for a page opened via `window.open`:
```js
await page.evaluate(() => window.open('https://www.example.com/'));
const newWindowTarget = await browser.waitForTarget(target => target.url() === 'https://www.example.com/');
```

View File

@ -0,0 +1,25 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [Browser](./puppeteer.browser.md) &gt; [wsEndpoint](./puppeteer.browser.wsendpoint.md)
## Browser.wsEndpoint() method
The browser websocket endpoint which can be used as an argument to [Puppeteer.connect()](./puppeteer.puppeteer.connect.md).
<b>Signature:</b>
```typescript
wsEndpoint(): string;
```
<b>Returns:</b>
string
The Browser websocket url.
## Remarks
The format is `ws://${host}:${port}/devtools/browser/<id>`.
You can find the `webSocketDebuggerUrl` from `http://${host}:${port}/json/version`. Learn more about the [devtools protocol](https://chromedevtools.github.io/devtools-protocol) and the [browser endpoint](https://chromedevtools.github.io/devtools-protocol/#how-do-i-access-the-browser-target).

View File

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [BrowserConnectOptions](./puppeteer.browserconnectoptions.md) &gt; [defaultViewport](./puppeteer.browserconnectoptions.defaultviewport.md)
## BrowserConnectOptions.defaultViewport property
Sets the viewport for each page.
<b>Signature:</b>
```typescript
defaultViewport?: Viewport | null;
```

View File

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [BrowserConnectOptions](./puppeteer.browserconnectoptions.md) &gt; [ignoreHTTPSErrors](./puppeteer.browserconnectoptions.ignorehttpserrors.md)
## BrowserConnectOptions.ignoreHTTPSErrors property
Whether to ignore HTTPS errors during navigation.
<b>Signature:</b>
```typescript
ignoreHTTPSErrors?: boolean;
```

View File

@ -0,0 +1,23 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [BrowserConnectOptions](./puppeteer.browserconnectoptions.md)
## BrowserConnectOptions interface
Generic browser options that can be passed when launching any browser or when connecting to an existing browser instance.
<b>Signature:</b>
```typescript
export interface BrowserConnectOptions
```
## Properties
| Property | 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. |

View File

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [BrowserConnectOptions](./puppeteer.browserconnectoptions.md) &gt; [slowMo](./puppeteer.browserconnectoptions.slowmo.md)
## BrowserConnectOptions.slowMo property
Slows down Puppeteer operations by the specified amount of milliseconds to aid debugging.
<b>Signature:</b>
```typescript
slowMo?: number;
```

View File

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [BrowserConnectOptions](./puppeteer.browserconnectoptions.md) &gt; [targetFilter](./puppeteer.browserconnectoptions.targetfilter.md)
## BrowserConnectOptions.targetFilter property
Callback to decide if Puppeteer should connect to a given target or not.
<b>Signature:</b>
```typescript
targetFilter?: TargetFilterCallback;
```

View File

@ -0,0 +1,17 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [BrowserContext](./puppeteer.browsercontext.md) &gt; [browser](./puppeteer.browsercontext.browser.md)
## BrowserContext.browser() method
The browser this browser context belongs to.
<b>Signature:</b>
```typescript
browser(): Browser;
```
<b>Returns:</b>
[Browser](./puppeteer.browser.md)

View File

@ -0,0 +1,28 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [BrowserContext](./puppeteer.browsercontext.md) &gt; [clearPermissionOverrides](./puppeteer.browsercontext.clearpermissionoverrides.md)
## BrowserContext.clearPermissionOverrides() method
Clears all permission overrides for the browser context.
<b>Signature:</b>
```typescript
clearPermissionOverrides(): Promise<void>;
```
<b>Returns:</b>
Promise&lt;void&gt;
## Example
```js
const context = browser.defaultBrowserContext();
context.overridePermissions('https://example.com', ['clipboard-read']);
// do stuff ..
context.clearPermissionOverrides();
```

View File

@ -0,0 +1,21 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [BrowserContext](./puppeteer.browsercontext.md) &gt; [close](./puppeteer.browsercontext.close.md)
## BrowserContext.close() method
Closes the browser context. All the targets that belong to the browser context will be closed.
<b>Signature:</b>
```typescript
close(): Promise<void>;
```
<b>Returns:</b>
Promise&lt;void&gt;
## Remarks
Only incognito browser contexts can be closed.

View File

@ -0,0 +1,21 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [BrowserContext](./puppeteer.browsercontext.md) &gt; [isIncognito](./puppeteer.browsercontext.isincognito.md)
## BrowserContext.isIncognito() method
Returns whether BrowserContext is incognito. The default browser context is the only non-incognito browser context.
<b>Signature:</b>
```typescript
isIncognito(): boolean;
```
<b>Returns:</b>
boolean
## Remarks
The default browser context cannot be closed.

View File

@ -0,0 +1,54 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [BrowserContext](./puppeteer.browsercontext.md)
## BrowserContext class
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.
<b>Signature:</b>
```typescript
export declare class BrowserContext extends EventEmitter
```
<b>Extends:</b> [EventEmitter](./puppeteer.eventemitter.md)
## Remarks
The Browser class extends from Puppeteer's [EventEmitter](./puppeteer.eventemitter.md) class and will emit various events which are documented in the [BrowserContextEmittedEvents](./puppeteer.browsercontextemittedevents.md) enum.
If a page opens another page, e.g. with a `window.open` call, the popup will belong to the parent page's browser context.
Puppeteer allows creation of "incognito" browser contexts with [Browser.createIncognitoBrowserContext](./puppeteer.browser.createincognitobrowsercontext.md) method. "Incognito" browser contexts don't write any browsing data to disk.
The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `BrowserContext` class.
## Example
```js
// Create a new incognito browser context
const context = await browser.createIncognitoBrowserContext();
// Create a new page inside context.
const page = await context.newPage();
// ... do stuff with page ...
await page.goto('https://example.com');
// Dispose context once it's no longer needed.
await context.close();
```
## Methods
| Method | Modifiers | Description |
| --- | --- | --- |
| [browser()](./puppeteer.browsercontext.browser.md) | | The browser this browser context belongs to. |
| [clearPermissionOverrides()](./puppeteer.browsercontext.clearpermissionoverrides.md) | | Clears all permission overrides for the browser context. |
| [close()](./puppeteer.browsercontext.close.md) | | Closes the browser context. All the targets that belong to the browser context will be closed. |
| [isIncognito()](./puppeteer.browsercontext.isincognito.md) | | Returns whether BrowserContext is incognito. The default browser context is the only non-incognito browser context. |
| [newPage()](./puppeteer.browsercontext.newpage.md) | | Creates a new page in the browser context. |
| [overridePermissions(origin, permissions)](./puppeteer.browsercontext.overridepermissions.md) | | |
| [pages()](./puppeteer.browsercontext.pages.md) | | An array of all pages inside the browser context. |
| [targets()](./puppeteer.browsercontext.targets.md) | | An array of all active targets inside the browser context. |
| [waitForTarget(predicate, options)](./puppeteer.browsercontext.waitfortarget.md) | | This searches for a target in this specific browser context. |

View File

@ -0,0 +1,17 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [BrowserContext](./puppeteer.browsercontext.md) &gt; [newPage](./puppeteer.browsercontext.newpage.md)
## BrowserContext.newPage() method
Creates a new page in the browser context.
<b>Signature:</b>
```typescript
newPage(): Promise<Page>;
```
<b>Returns:</b>
Promise&lt;[Page](./puppeteer.page.md)&gt;

View File

@ -0,0 +1,32 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [BrowserContext](./puppeteer.browsercontext.md) &gt; [overridePermissions](./puppeteer.browsercontext.overridepermissions.md)
## BrowserContext.overridePermissions() method
<b>Signature:</b>
```typescript
overridePermissions(origin: string, permissions: Permission[]): Promise<void>;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| origin | string | The origin to grant permissions to, e.g. "https://example.com". |
| permissions | [Permission](./puppeteer.permission.md)\[\] | An array of permissions to grant. All permissions that are not listed here will be automatically denied. |
<b>Returns:</b>
Promise&lt;void&gt;
## Example
```js
const context = browser.defaultBrowserContext();
await context.overridePermissions('https://html5demos.com', ['geolocation']);
```

View File

@ -0,0 +1,19 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [BrowserContext](./puppeteer.browsercontext.md) &gt; [pages](./puppeteer.browsercontext.pages.md)
## BrowserContext.pages() method
An array of all pages inside the browser context.
<b>Signature:</b>
```typescript
pages(): Promise<Page[]>;
```
<b>Returns:</b>
Promise&lt;[Page](./puppeteer.page.md)\[\]&gt;
Promise which resolves to an array of all open pages. Non visible pages, such as `"background_page"`, will not be listed here. You can find them using [the target page](./puppeteer.target.page.md).

View File

@ -0,0 +1,17 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [BrowserContext](./puppeteer.browsercontext.md) &gt; [targets](./puppeteer.browsercontext.targets.md)
## BrowserContext.targets() method
An array of all active targets inside the browser context.
<b>Signature:</b>
```typescript
targets(): Target[];
```
<b>Returns:</b>
[Target](./puppeteer.target.md)\[\]

View File

@ -0,0 +1,39 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [BrowserContext](./puppeteer.browsercontext.md) &gt; [waitForTarget](./puppeteer.browsercontext.waitfortarget.md)
## BrowserContext.waitForTarget() method
This searches for a target in this specific browser context.
<b>Signature:</b>
```typescript
waitForTarget(predicate: (x: Target) => boolean, options?: {
timeout?: number;
}): Promise<Target>;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| predicate | (x: [Target](./puppeteer.target.md)) =&gt; boolean | A function to be run for every target |
| options | { timeout?: number; } | An object of options. Accepts a timout, which is the maximum wait time in milliseconds. Pass <code>0</code> to disable the timeout. Defaults to 30 seconds. |
<b>Returns:</b>
Promise&lt;[Target](./puppeteer.target.md)&gt;
Promise which resolves to the first target found that matches the `predicate` function.
## Example
An example of finding a target for a page opened via `window.open`:
```js
await page.evaluate(() => window.open('https://www.example.com/'));
const newWindowTarget = await browserContext.waitForTarget(target => target.url() === 'https://www.example.com/');
```

View File

@ -0,0 +1,21 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [BrowserContextEmittedEvents](./puppeteer.browsercontextemittedevents.md)
## BrowserContextEmittedEvents enum
<b>Signature:</b>
```typescript
export declare const enum BrowserContextEmittedEvents
```
## Enumeration Members
| Member | Value | Description |
| --- | --- | --- |
| TargetChanged | <code>&quot;targetchanged&quot;</code> | Emitted when the url of a target inside the browser context changes. Contains a [Target](./puppeteer.target.md) instance. |
| TargetCreated | <code>&quot;targetcreated&quot;</code> | Emitted when a target is created within the browser context, for example when a new page is opened by [window.open](https://developer.mozilla.org/en-US/docs/Web/API/Window/open) or by [browserContext.newPage](./puppeteer.browsercontext.newpage.md)Contains a [Target](./puppeteer.target.md) instance. |
| TargetDestroyed | <code>&quot;targetdestroyed&quot;</code> | Emitted when a target is destroyed within the browser context, for example when a page is closed. Contains a [Target](./puppeteer.target.md) instance. |

View File

@ -0,0 +1,23 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [BrowserEmittedEvents](./puppeteer.browseremittedevents.md)
## BrowserEmittedEvents enum
All the events a [browser instance](./puppeteer.browser.md) may emit.
<b>Signature:</b>
```typescript
export declare const enum BrowserEmittedEvents
```
## Enumeration Members
| Member | Value | Description |
| --- | --- | --- |
| Disconnected | <code>&quot;disconnected&quot;</code> | Emitted when Puppeteer gets disconnected from the Chromium instance. This might happen because of one of the following:- Chromium is closed or crashed- The [browser.disconnect](./puppeteer.browser.disconnect.md) method was called. |
| TargetChanged | <code>&quot;targetchanged&quot;</code> | Emitted when the url of a target changes. Contains a [Target](./puppeteer.target.md) instance. |
| TargetCreated | <code>&quot;targetcreated&quot;</code> | Emitted when a target is created, for example when a new page is opened by [window.open](https://developer.mozilla.org/en-US/docs/Web/API/Window/open) or by [browser.newPage](./puppeteer.browser.newpage.md)Contains a [Target](./puppeteer.target.md) instance. |
| TargetDestroyed | <code>&quot;targetdestroyed&quot;</code> | Emitted when a target is destroyed, for example when a page is closed. Contains a [Target](./puppeteer.target.md) instance. |

View File

@ -0,0 +1,30 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [BrowserFetcher](./puppeteer.browserfetcher.md) &gt; [canDownload](./puppeteer.browserfetcher.candownload.md)
## BrowserFetcher.canDownload() method
Initiates a HEAD request to check if the revision is available.
<b>Signature:</b>
```typescript
canDownload(revision: string): Promise<boolean>;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| revision | string | The revision to check availability for. |
<b>Returns:</b>
Promise&lt;boolean&gt;
A promise that resolves to `true` if the revision could be downloaded from the host.
## Remarks
This method is affected by the current `product`.

View File

@ -0,0 +1,31 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [BrowserFetcher](./puppeteer.browserfetcher.md) &gt; [download](./puppeteer.browserfetcher.download.md)
## BrowserFetcher.download() method
Initiates a GET request to download the revision from the host.
<b>Signature:</b>
```typescript
download(revision: string, progressCallback?: (x: number, y: number) => void): Promise<BrowserFetcherRevisionInfo>;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| revision | string | The revision to download. |
| progressCallback | (x: number, y: number) =&gt; void | A function that will be called with two arguments: How many bytes have been downloaded and the total number of bytes of the download. |
<b>Returns:</b>
Promise&lt;[BrowserFetcherRevisionInfo](./puppeteer.browserfetcherrevisioninfo.md)&gt;
A promise with revision information when the revision is downloaded and extracted.
## Remarks
This method is affected by the current `product`.

View File

@ -0,0 +1,17 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [BrowserFetcher](./puppeteer.browserfetcher.md) &gt; [host](./puppeteer.browserfetcher.host.md)
## BrowserFetcher.host() method
<b>Signature:</b>
```typescript
host(): string;
```
<b>Returns:</b>
string
The download host being used.

View File

@ -0,0 +1,21 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [BrowserFetcher](./puppeteer.browserfetcher.md) &gt; [localRevisions](./puppeteer.browserfetcher.localrevisions.md)
## BrowserFetcher.localRevisions() method
<b>Signature:</b>
```typescript
localRevisions(): Promise<string[]>;
```
<b>Returns:</b>
Promise&lt;string\[\]&gt;
A promise with a list of all revision strings (for the current `product`) available locally on disk.
## Remarks
This method is affected by the current `product`.

View File

@ -0,0 +1,45 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [BrowserFetcher](./puppeteer.browserfetcher.md)
## BrowserFetcher class
BrowserFetcher can download and manage different versions of Chromium and Firefox.
<b>Signature:</b>
```typescript
export declare class BrowserFetcher
```
## Remarks
BrowserFetcher operates on revision strings that specify a precise version of Chromium, e.g. `"533271"`. Revision strings can be obtained from [omahaproxy.appspot.com](http://omahaproxy.appspot.com/). In the Firefox case, BrowserFetcher downloads Firefox Nightly and operates on version numbers such as `"75"`.
The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `BrowserFetcher` class.
## Example
An example of using BrowserFetcher to download a specific version of Chromium and running Puppeteer against it:
```js
const browserFetcher = puppeteer.createBrowserFetcher();
const revisionInfo = await browserFetcher.download('533271');
const browser = await puppeteer.launch({executablePath: revisionInfo.executablePath})
```
\*\*NOTE\*\* BrowserFetcher is not designed to work concurrently with other instances of BrowserFetcher that share the same downloads directory.
## Methods
| Method | Modifiers | Description |
| --- | --- | --- |
| [canDownload(revision)](./puppeteer.browserfetcher.candownload.md) | | Initiates a HEAD request to check if the revision is available. |
| [download(revision, progressCallback)](./puppeteer.browserfetcher.download.md) | | Initiates a GET request to download the revision from the host. |
| [host()](./puppeteer.browserfetcher.host.md) | | |
| [localRevisions()](./puppeteer.browserfetcher.localrevisions.md) | | |
| [platform()](./puppeteer.browserfetcher.platform.md) | | |
| [product()](./puppeteer.browserfetcher.product.md) | | |
| [remove(revision)](./puppeteer.browserfetcher.remove.md) | | |
| [revisionInfo(revision)](./puppeteer.browserfetcher.revisioninfo.md) | | |

View File

@ -0,0 +1,17 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [BrowserFetcher](./puppeteer.browserfetcher.md) &gt; [platform](./puppeteer.browserfetcher.platform.md)
## BrowserFetcher.platform() method
<b>Signature:</b>
```typescript
platform(): Platform;
```
<b>Returns:</b>
[Platform](./puppeteer.platform.md)
Returns the current `Platform`, which is one of `mac`, `linux`, `win32` or `win64`.

View File

@ -0,0 +1,17 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [BrowserFetcher](./puppeteer.browserfetcher.md) &gt; [product](./puppeteer.browserfetcher.product.md)
## BrowserFetcher.product() method
<b>Signature:</b>
```typescript
product(): Product;
```
<b>Returns:</b>
[Product](./puppeteer.product.md)
Returns the current `Product`, which is one of `chrome` or `firefox`.

View File

@ -0,0 +1,28 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [BrowserFetcher](./puppeteer.browserfetcher.md) &gt; [remove](./puppeteer.browserfetcher.remove.md)
## BrowserFetcher.remove() method
<b>Signature:</b>
```typescript
remove(revision: string): Promise<void>;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| revision | string | A revision to remove for the current <code>product</code>. |
<b>Returns:</b>
Promise&lt;void&gt;
A promise that resolves when the revision has been removes or throws if the revision has not been downloaded.
## Remarks
This method is affected by the current `product`.

View File

@ -0,0 +1,24 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [BrowserFetcher](./puppeteer.browserfetcher.md) &gt; [revisionInfo](./puppeteer.browserfetcher.revisioninfo.md)
## BrowserFetcher.revisionInfo() method
<b>Signature:</b>
```typescript
revisionInfo(revision: string): BrowserFetcherRevisionInfo;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| revision | string | The revision to get info for. |
<b>Returns:</b>
[BrowserFetcherRevisionInfo](./puppeteer.browserfetcherrevisioninfo.md)
The revision info for the given revision.

View File

@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [BrowserFetcherOptions](./puppeteer.browserfetcheroptions.md) &gt; [host](./puppeteer.browserfetcheroptions.host.md)
## BrowserFetcherOptions.host property
<b>Signature:</b>
```typescript
host?: string;
```

View File

@ -0,0 +1,22 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [BrowserFetcherOptions](./puppeteer.browserfetcheroptions.md)
## BrowserFetcherOptions interface
<b>Signature:</b>
```typescript
export interface BrowserFetcherOptions
```
## Properties
| Property | Type | Description |
| --- | --- | --- |
| [host?](./puppeteer.browserfetcheroptions.host.md) | string | <i>(Optional)</i> |
| [path?](./puppeteer.browserfetcheroptions.path.md) | string | <i>(Optional)</i> |
| [platform?](./puppeteer.browserfetcheroptions.platform.md) | [Platform](./puppeteer.platform.md) | <i>(Optional)</i> |
| [product?](./puppeteer.browserfetcheroptions.product.md) | string | <i>(Optional)</i> |

View File

@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [BrowserFetcherOptions](./puppeteer.browserfetcheroptions.md) &gt; [path](./puppeteer.browserfetcheroptions.path.md)
## BrowserFetcherOptions.path property
<b>Signature:</b>
```typescript
path?: string;
```

View File

@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [BrowserFetcherOptions](./puppeteer.browserfetcheroptions.md) &gt; [platform](./puppeteer.browserfetcheroptions.platform.md)
## BrowserFetcherOptions.platform property
<b>Signature:</b>
```typescript
platform?: Platform;
```

View File

@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [BrowserFetcherOptions](./puppeteer.browserfetcheroptions.md) &gt; [product](./puppeteer.browserfetcheroptions.product.md)
## BrowserFetcherOptions.product property
<b>Signature:</b>
```typescript
product?: string;
```

View File

@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [BrowserFetcherRevisionInfo](./puppeteer.browserfetcherrevisioninfo.md) &gt; [executablePath](./puppeteer.browserfetcherrevisioninfo.executablepath.md)
## BrowserFetcherRevisionInfo.executablePath property
<b>Signature:</b>
```typescript
executablePath: string;
```

View File

@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [BrowserFetcherRevisionInfo](./puppeteer.browserfetcherrevisioninfo.md) &gt; [folderPath](./puppeteer.browserfetcherrevisioninfo.folderpath.md)
## BrowserFetcherRevisionInfo.folderPath property
<b>Signature:</b>
```typescript
folderPath: string;
```

View File

@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [BrowserFetcherRevisionInfo](./puppeteer.browserfetcherrevisioninfo.md) &gt; [local](./puppeteer.browserfetcherrevisioninfo.local.md)
## BrowserFetcherRevisionInfo.local property
<b>Signature:</b>
```typescript
local: boolean;
```

View File

@ -0,0 +1,24 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [BrowserFetcherRevisionInfo](./puppeteer.browserfetcherrevisioninfo.md)
## BrowserFetcherRevisionInfo interface
<b>Signature:</b>
```typescript
export interface BrowserFetcherRevisionInfo
```
## Properties
| Property | 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 | |

View File

@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [BrowserFetcherRevisionInfo](./puppeteer.browserfetcherrevisioninfo.md) &gt; [product](./puppeteer.browserfetcherrevisioninfo.product.md)
## BrowserFetcherRevisionInfo.product property
<b>Signature:</b>
```typescript
product: string;
```

View File

@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [BrowserFetcherRevisionInfo](./puppeteer.browserfetcherrevisioninfo.md) &gt; [revision](./puppeteer.browserfetcherrevisioninfo.revision.md)
## BrowserFetcherRevisionInfo.revision property
<b>Signature:</b>
```typescript
revision: string;
```

View File

@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [BrowserFetcherRevisionInfo](./puppeteer.browserfetcherrevisioninfo.md) &gt; [url](./puppeteer.browserfetcherrevisioninfo.url.md)
## BrowserFetcherRevisionInfo.url property
<b>Signature:</b>
```typescript
url: string;
```

View File

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [BrowserLaunchArgumentOptions](./puppeteer.browserlaunchargumentoptions.md) &gt; [args](./puppeteer.browserlaunchargumentoptions.args.md)
## BrowserLaunchArgumentOptions.args property
Additional command line arguments to pass to the browser instance.
<b>Signature:</b>
```typescript
args?: string[];
```

View File

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [BrowserLaunchArgumentOptions](./puppeteer.browserlaunchargumentoptions.md) &gt; [devtools](./puppeteer.browserlaunchargumentoptions.devtools.md)
## BrowserLaunchArgumentOptions.devtools property
Whether to auto-open a DevTools panel for each tab. If this is set to `true`, then `headless` will be set to `false` automatically.
<b>Signature:</b>
```typescript
devtools?: boolean;
```

View File

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [BrowserLaunchArgumentOptions](./puppeteer.browserlaunchargumentoptions.md) &gt; [headless](./puppeteer.browserlaunchargumentoptions.headless.md)
## BrowserLaunchArgumentOptions.headless property
Whether to run the browser in headless mode.
<b>Signature:</b>
```typescript
headless?: boolean;
```

View File

@ -0,0 +1,23 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [BrowserLaunchArgumentOptions](./puppeteer.browserlaunchargumentoptions.md)
## BrowserLaunchArgumentOptions interface
Launcher options that only apply to Chrome.
<b>Signature:</b>
```typescript
export interface BrowserLaunchArgumentOptions
```
## Properties
| Property | Type | Description |
| --- | --- | --- |
| [args?](./puppeteer.browserlaunchargumentoptions.args.md) | string\[\] | <i>(Optional)</i> Additional command line arguments to pass to the browser instance. |
| [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 set to <code>false</code> automatically. |
| [headless?](./puppeteer.browserlaunchargumentoptions.headless.md) | boolean | <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/+/master/docs/user_data_dir.md) for more info. |

View File

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [BrowserLaunchArgumentOptions](./puppeteer.browserlaunchargumentoptions.md) &gt; [userDataDir](./puppeteer.browserlaunchargumentoptions.userdatadir.md)
## BrowserLaunchArgumentOptions.userDataDir property
Path to a user data directory. [see the Chromium docs](https://chromium.googlesource.com/chromium/src/+/master/docs/user_data_dir.md) for more info.
<b>Signature:</b>
```typescript
userDataDir?: string;
```

View File

@ -0,0 +1,15 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [CDPSession](./puppeteer.cdpsession.md) &gt; [connection](./puppeteer.cdpsession.connection.md)
## CDPSession.connection() method
<b>Signature:</b>
```typescript
connection(): Connection;
```
<b>Returns:</b>
[Connection](./puppeteer.connection.md)

View File

@ -0,0 +1,17 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [CDPSession](./puppeteer.cdpsession.md) &gt; [detach](./puppeteer.cdpsession.detach.md)
## CDPSession.detach() method
Detaches the cdpSession from the target. Once detached, the cdpSession object won't emit any events and can't be used to send messages.
<b>Signature:</b>
```typescript
detach(): Promise<void>;
```
<b>Returns:</b>
Promise&lt;void&gt;

View File

@ -0,0 +1,46 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [CDPSession](./puppeteer.cdpsession.md)
## CDPSession class
The `CDPSession` instances are used to talk raw Chrome Devtools Protocol.
<b>Signature:</b>
```typescript
export declare class CDPSession extends EventEmitter
```
<b>Extends:</b> [EventEmitter](./puppeteer.eventemitter.md)
## Remarks
Protocol methods can be called with [CDPSession.send()](./puppeteer.cdpsession.send.md) method and protocol events can be subscribed to with `CDPSession.on` method.
Useful links: [DevTools Protocol Viewer](https://chromedevtools.github.io/devtools-protocol/) and [Getting Started with DevTools Protocol](https://github.com/aslushnikov/getting-started-with-cdp/blob/master/README.md).
The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `CDPSession` class.
## Example
```js
const client = await page.target().createCDPSession();
await client.send('Animation.enable');
client.on('Animation.animationCreated', () => console.log('Animation created!'));
const response = await client.send('Animation.getPlaybackRate');
console.log('playback rate is ' + response.playbackRate);
await client.send('Animation.setPlaybackRate', {
playbackRate: response.playbackRate / 2
});
```
## Methods
| Method | Modifiers | Description |
| --- | --- | --- |
| [connection()](./puppeteer.cdpsession.connection.md) | | |
| [detach()](./puppeteer.cdpsession.detach.md) | | Detaches the cdpSession from the target. Once detached, the cdpSession object won't emit any events and can't be used to send messages. |
| [send(method, paramArgs)](./puppeteer.cdpsession.send.md) | | |

View File

@ -0,0 +1,23 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [CDPSession](./puppeteer.cdpsession.md) &gt; [send](./puppeteer.cdpsession.send.md)
## CDPSession.send() method
<b>Signature:</b>
```typescript
send<T extends keyof ProtocolMapping.Commands>(method: T, ...paramArgs: ProtocolMapping.Commands[T]['paramsType']): Promise<ProtocolMapping.Commands[T]['returnType']>;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| method | T | |
| paramArgs | ProtocolMapping.Commands\[T\]\['paramsType'\] | |
<b>Returns:</b>
Promise&lt;ProtocolMapping.Commands\[T\]\['returnType'\]&gt;

View File

@ -0,0 +1,14 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [CDPSessionOnMessageObject](./puppeteer.cdpsessiononmessageobject.md) &gt; [error](./puppeteer.cdpsessiononmessageobject.error.md)
## CDPSessionOnMessageObject.error property
<b>Signature:</b>
```typescript
error: {
message: string;
data: any;
};
```

View File

@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [CDPSessionOnMessageObject](./puppeteer.cdpsessiononmessageobject.md) &gt; [id](./puppeteer.cdpsessiononmessageobject.id.md)
## CDPSessionOnMessageObject.id property
<b>Signature:</b>
```typescript
id?: number;
```

View File

@ -0,0 +1,23 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [CDPSessionOnMessageObject](./puppeteer.cdpsessiononmessageobject.md)
## CDPSessionOnMessageObject interface
<b>Signature:</b>
```typescript
export interface CDPSessionOnMessageObject
```
## Properties
| Property | Type | Description |
| --- | --- | --- |
| [error](./puppeteer.cdpsessiononmessageobject.error.md) | { message: string; data: any; } | |
| [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

@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [CDPSessionOnMessageObject](./puppeteer.cdpsessiononmessageobject.md) &gt; [method](./puppeteer.cdpsessiononmessageobject.method.md)
## CDPSessionOnMessageObject.method property
<b>Signature:</b>
```typescript
method: string;
```

View File

@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [CDPSessionOnMessageObject](./puppeteer.cdpsessiononmessageobject.md) &gt; [params](./puppeteer.cdpsessiononmessageobject.params.md)
## CDPSessionOnMessageObject.params property
<b>Signature:</b>
```typescript
params: Record<string, unknown>;
```

View File

@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [CDPSessionOnMessageObject](./puppeteer.cdpsessiononmessageobject.md) &gt; [result](./puppeteer.cdpsessiononmessageobject.result.md)
## CDPSessionOnMessageObject.result property
<b>Signature:</b>
```typescript
result?: any;
```

View File

@ -0,0 +1,12 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [ChromeReleaseChannel](./puppeteer.chromereleasechannel.md)
## ChromeReleaseChannel type
<b>Signature:</b>
```typescript
export declare type ChromeReleaseChannel = 'chrome' | 'chrome-beta' | 'chrome-canary' | 'chrome-dev';
```

View File

@ -0,0 +1,17 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [clearCustomQueryHandlers](./puppeteer.clearcustomqueryhandlers.md)
## clearCustomQueryHandlers() function
Clears all registered handlers.
<b>Signature:</b>
```typescript
export declare function clearCustomQueryHandlers(): void;
```
<b>Returns:</b>
void

View File

@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [ClickOptions](./puppeteer.clickoptions.md) &gt; [button](./puppeteer.clickoptions.button.md)
## ClickOptions.button property
<b>Signature:</b>
```typescript
button?: 'left' | 'right' | 'middle';
```

View File

@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [ClickOptions](./puppeteer.clickoptions.md) &gt; [clickCount](./puppeteer.clickoptions.clickcount.md)
## ClickOptions.clickCount property
<b>Signature:</b>
```typescript
clickCount?: number;
```

View File

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [ClickOptions](./puppeteer.clickoptions.md) &gt; [delay](./puppeteer.clickoptions.delay.md)
## ClickOptions.delay property
Time to wait between `mousedown` and `mouseup` in milliseconds.
<b>Signature:</b>
```typescript
delay?: number;
```

View File

@ -0,0 +1,21 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [ClickOptions](./puppeteer.clickoptions.md)
## ClickOptions interface
<b>Signature:</b>
```typescript
export interface ClickOptions
```
## Properties
| Property | Type | Description |
| --- | --- | --- |
| [button?](./puppeteer.clickoptions.button.md) | 'left' \| 'right' \| 'middle' | <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. |

View File

@ -0,0 +1,23 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [CommonEventEmitter](./puppeteer.commoneventemitter.md) &gt; [addListener](./puppeteer.commoneventemitter.addlistener.md)
## CommonEventEmitter.addListener() method
<b>Signature:</b>
```typescript
addListener(event: EventType, handler: Handler): CommonEventEmitter;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| event | [EventType](./puppeteer.eventtype.md) | |
| handler | [Handler](./puppeteer.handler.md) | |
<b>Returns:</b>
[CommonEventEmitter](./puppeteer.commoneventemitter.md)

View File

@ -0,0 +1,23 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [CommonEventEmitter](./puppeteer.commoneventemitter.md) &gt; [emit](./puppeteer.commoneventemitter.emit.md)
## CommonEventEmitter.emit() method
<b>Signature:</b>
```typescript
emit(event: EventType, eventData?: unknown): boolean;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| event | [EventType](./puppeteer.eventtype.md) | |
| eventData | unknown | |
<b>Returns:</b>
boolean

View File

@ -0,0 +1,22 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [CommonEventEmitter](./puppeteer.commoneventemitter.md) &gt; [listenerCount](./puppeteer.commoneventemitter.listenercount.md)
## CommonEventEmitter.listenerCount() method
<b>Signature:</b>
```typescript
listenerCount(event: string): number;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| event | string | |
<b>Returns:</b>
number

View File

@ -0,0 +1,26 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [CommonEventEmitter](./puppeteer.commoneventemitter.md)
## CommonEventEmitter interface
<b>Signature:</b>
```typescript
export interface CommonEventEmitter
```
## Methods
| Method | Description |
| --- | --- |
| [addListener(event, handler)](./puppeteer.commoneventemitter.addlistener.md) | |
| [emit(event, eventData)](./puppeteer.commoneventemitter.emit.md) | |
| [listenerCount(event)](./puppeteer.commoneventemitter.listenercount.md) | |
| [off(event, handler)](./puppeteer.commoneventemitter.off.md) | |
| [on(event, handler)](./puppeteer.commoneventemitter.on.md) | |
| [once(event, handler)](./puppeteer.commoneventemitter.once.md) | |
| [removeAllListeners(event)](./puppeteer.commoneventemitter.removealllisteners.md) | |
| [removeListener(event, handler)](./puppeteer.commoneventemitter.removelistener.md) | |

View File

@ -0,0 +1,23 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [CommonEventEmitter](./puppeteer.commoneventemitter.md) &gt; [off](./puppeteer.commoneventemitter.off.md)
## CommonEventEmitter.off() method
<b>Signature:</b>
```typescript
off(event: EventType, handler: Handler): CommonEventEmitter;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| event | [EventType](./puppeteer.eventtype.md) | |
| handler | [Handler](./puppeteer.handler.md) | |
<b>Returns:</b>
[CommonEventEmitter](./puppeteer.commoneventemitter.md)

View File

@ -0,0 +1,23 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [CommonEventEmitter](./puppeteer.commoneventemitter.md) &gt; [on](./puppeteer.commoneventemitter.on.md)
## CommonEventEmitter.on() method
<b>Signature:</b>
```typescript
on(event: EventType, handler: Handler): CommonEventEmitter;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| event | [EventType](./puppeteer.eventtype.md) | |
| handler | [Handler](./puppeteer.handler.md) | |
<b>Returns:</b>
[CommonEventEmitter](./puppeteer.commoneventemitter.md)

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