chore: gitignore new-docs (#6511)

They are generating a lot of noise in PRs. This commit removes them from git, but updates CI to generate them - to ensure there are no errors when generating the new documentation.

Further commits will:

1. Introduce linting to enforce methods are documented.
2. Generate previews of the new docs via GitHub actions or similar.
This commit is contained in:
Jack Franklin 2020-10-14 11:44:40 +01:00 committed by GitHub
parent e655bb6ca2
commit 637a1f7409
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4147 changed files with 3 additions and 66549 deletions

1
.gitignore vendored
View File

@ -18,3 +18,4 @@ test/coverage.json
temp/
dependency-chart.png
puppeteer-core-*.tgz
new-docs/

View File

@ -71,7 +71,8 @@ jobs:
- CHROMIUM=true
script:
- npm run lint
- npm run ensure-new-docs-up-to-date
# Ensure that we can generate the new docs without erroring
- npm run generate-docs
- npm run ensure-correct-devtools-protocol-revision
# This bot runs separately as it changes package.json to test puppeteer-core

View File

@ -1,12 +0,0 @@
<!-- 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

@ -1,30 +0,0 @@
<!-- 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

@ -1,61 +0,0 @@
<!-- 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

@ -1,13 +0,0 @@
<!-- 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

@ -1,22 +0,0 @@
<!-- 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

@ -1,13 +0,0 @@
<!-- 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

@ -1,13 +0,0 @@
<!-- 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

@ -1,13 +0,0 @@
<!-- 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

@ -1,14 +0,0 @@
<!-- 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

@ -1,14 +0,0 @@
<!-- 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

@ -1,11 +0,0 @@
<!-- 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

@ -1,14 +0,0 @@
<!-- 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

@ -1,23 +0,0 @@
<!-- 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

@ -1,14 +0,0 @@
<!-- 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

@ -1,11 +0,0 @@
<!-- 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

@ -1,17 +0,0 @@
<!-- 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

@ -1,17 +0,0 @@
<!-- 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

@ -1,33 +0,0 @@
<!-- 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

@ -1,17 +0,0 @@
<!-- 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

@ -1,17 +0,0 @@
<!-- 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

@ -1,17 +0,0 @@
<!-- 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

@ -1,79 +0,0 @@
<!-- 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) | | Creates a [Page](./puppeteer.page.md) in the 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

@ -1,17 +0,0 @@
<!-- 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
Creates a [Page](./puppeteer.page.md) in the default browser context.
<b>Signature:</b>
```typescript
newPage(): Promise<Page>;
```
<b>Returns:</b>
Promise&lt;[Page](./puppeteer.page.md)<!-- -->&gt;

View File

@ -1,21 +0,0 @@
<!-- 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

@ -1,17 +0,0 @@
<!-- 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

@ -1,17 +0,0 @@
<!-- 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

@ -1,17 +0,0 @@
<!-- 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

@ -1,17 +0,0 @@
<!-- 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

@ -1,23 +0,0 @@
<!-- 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

@ -1,37 +0,0 @@
<!-- 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

@ -1,25 +0,0 @@
<!-- 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

@ -1,17 +0,0 @@
<!-- 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

@ -1,28 +0,0 @@
<!-- 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

@ -1,21 +0,0 @@
<!-- 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

@ -1,21 +0,0 @@
<!-- 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

@ -1,54 +0,0 @@
<!-- 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

@ -1,17 +0,0 @@
<!-- 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

@ -1,32 +0,0 @@
<!-- 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: string[]): Promise<void>;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| origin | string | The origin to grant permissions to, e.g. "https://example.com". |
| permissions | string\[\] | 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

@ -1,19 +0,0 @@
<!-- 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

@ -1,17 +0,0 @@
<!-- 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

@ -1,39 +0,0 @@
<!-- 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

@ -1,20 +0,0 @@
<!-- 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

@ -1,23 +0,0 @@
<!-- 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

@ -1,30 +0,0 @@
<!-- 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

@ -1,31 +0,0 @@
<!-- 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

@ -1,17 +0,0 @@
<!-- 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

@ -1,21 +0,0 @@
<!-- 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

@ -1,45 +0,0 @@
<!-- 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

@ -1,17 +0,0 @@
<!-- 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`<!-- -->.

View File

@ -1,17 +0,0 @@
<!-- 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`<!-- -->.

View File

@ -1,28 +0,0 @@
<!-- 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

@ -1,24 +0,0 @@
<!-- 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

@ -1,11 +0,0 @@
<!-- 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

@ -1,22 +0,0 @@
<!-- 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 | |
| [path](./puppeteer.browserfetcheroptions.path.md) | string | |
| [platform](./puppeteer.browserfetcheroptions.platform.md) | [Platform](./puppeteer.platform.md) | |
| [product](./puppeteer.browserfetcheroptions.product.md) | string | |

View File

@ -1,11 +0,0 @@
<!-- 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

@ -1,11 +0,0 @@
<!-- 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

@ -1,11 +0,0 @@
<!-- 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

@ -1,11 +0,0 @@
<!-- 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

@ -1,11 +0,0 @@
<!-- 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

@ -1,11 +0,0 @@
<!-- 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

@ -1,24 +0,0 @@
<!-- 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

@ -1,11 +0,0 @@
<!-- 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

@ -1,11 +0,0 @@
<!-- 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

@ -1,11 +0,0 @@
<!-- 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

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

View File

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

View File

@ -1,22 +0,0 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [BrowserOptions](./puppeteer.browseroptions.md)
## BrowserOptions interface
Generic browser options that can be passed when launching any browser.
<b>Signature:</b>
```typescript
export interface BrowserOptions
```
## Properties
| Property | Type | Description |
| --- | --- | --- |
| [defaultViewport](./puppeteer.browseroptions.defaultviewport.md) | Viewport | |
| [ignoreHTTPSErrors](./puppeteer.browseroptions.ignorehttpserrors.md) | boolean | |
| [slowMo](./puppeteer.browseroptions.slowmo.md) | number | |

View File

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

View File

@ -1,17 +0,0 @@
<!-- 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

@ -1,45 +0,0 @@
<!-- 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 |
| --- | --- | --- |
| [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

@ -1,23 +0,0 @@
<!-- 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

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

View File

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

View File

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

View File

@ -1,23 +0,0 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [ChromeArgOptions](./puppeteer.chromeargoptions.md)
## ChromeArgOptions interface
Launcher options that only apply to Chrome.
<b>Signature:</b>
```typescript
export interface ChromeArgOptions
```
## Properties
| Property | Type | Description |
| --- | --- | --- |
| [args](./puppeteer.chromeargoptions.args.md) | string\[\] | |
| [devtools](./puppeteer.chromeargoptions.devtools.md) | boolean | |
| [headless](./puppeteer.chromeargoptions.headless.md) | boolean | |
| [userDataDir](./puppeteer.chromeargoptions.userdatadir.md) | string | |

View File

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

View File

@ -1,11 +0,0 @@
<!-- 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

@ -1,11 +0,0 @@
<!-- 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

@ -1,13 +0,0 @@
<!-- 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

@ -1,21 +0,0 @@
<!-- 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' | |
| [clickCount](./puppeteer.clickoptions.clickcount.md) | number | |
| [delay](./puppeteer.clickoptions.delay.md) | number | Time to wait between <code>mousedown</code> and <code>mouseup</code> in milliseconds. |

View File

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

View File

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

View File

@ -1,22 +0,0 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [ConnectOptions](./puppeteer.connectoptions.md)
## ConnectOptions interface
<b>Signature:</b>
```typescript
export interface ConnectOptions extends BrowserOptions
```
<b>Extends:</b> [BrowserOptions](./puppeteer.browseroptions.md)
## Properties
| Property | Type | Description |
| --- | --- | --- |
| [browserURL](./puppeteer.connectoptions.browserurl.md) | string | |
| [browserWSEndpoint](./puppeteer.connectoptions.browserwsendpoint.md) | string | |
| [product](./puppeteer.connectoptions.product.md) | [Product](./puppeteer.product.md) | |
| [transport](./puppeteer.connectoptions.transport.md) | ConnectionTransport | |

View File

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

View File

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

View File

@ -1,23 +0,0 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [ConsoleMessage](./puppeteer.consolemessage.md) &gt; [(constructor)](./puppeteer.consolemessage._constructor_.md)
## ConsoleMessage.(constructor)
Constructs a new instance of the `ConsoleMessage` class
<b>Signature:</b>
```typescript
constructor(type: ConsoleMessageType, text: string, args: JSHandle[], stackTraceLocations: ConsoleMessageLocation[]);
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| type | [ConsoleMessageType](./puppeteer.consolemessagetype.md) | |
| text | string | |
| args | [JSHandle](./puppeteer.jshandle.md)<!-- -->\[\] | |
| stackTraceLocations | [ConsoleMessageLocation](./puppeteer.consolemessagelocation.md)<!-- -->\[\] | |

View File

@ -1,17 +0,0 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [ConsoleMessage](./puppeteer.consolemessage.md) &gt; [args](./puppeteer.consolemessage.args.md)
## ConsoleMessage.args() method
<b>Signature:</b>
```typescript
args(): JSHandle[];
```
<b>Returns:</b>
[JSHandle](./puppeteer.jshandle.md)<!-- -->\[\]
An array of arguments passed to the console.

View File

@ -1,17 +0,0 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [ConsoleMessage](./puppeteer.consolemessage.md) &gt; [location](./puppeteer.consolemessage.location.md)
## ConsoleMessage.location() method
<b>Signature:</b>
```typescript
location(): ConsoleMessageLocation;
```
<b>Returns:</b>
[ConsoleMessageLocation](./puppeteer.consolemessagelocation.md)
The location of the console message.

View File

@ -1,30 +0,0 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [ConsoleMessage](./puppeteer.consolemessage.md)
## ConsoleMessage class
ConsoleMessage objects are dispatched by page via the 'console' event.
<b>Signature:</b>
```typescript
export declare class ConsoleMessage
```
## Constructors
| Constructor | Modifiers | Description |
| --- | --- | --- |
| [(constructor)(type, text, args, stackTraceLocations)](./puppeteer.consolemessage._constructor_.md) | | Constructs a new instance of the <code>ConsoleMessage</code> class |
## Methods
| Method | Modifiers | Description |
| --- | --- | --- |
| [args()](./puppeteer.consolemessage.args.md) | | |
| [location()](./puppeteer.consolemessage.location.md) | | |
| [stackTrace()](./puppeteer.consolemessage.stacktrace.md) | | |
| [text()](./puppeteer.consolemessage.text.md) | | |
| [type()](./puppeteer.consolemessage.type.md) | | |

View File

@ -1,17 +0,0 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [ConsoleMessage](./puppeteer.consolemessage.md) &gt; [stackTrace](./puppeteer.consolemessage.stacktrace.md)
## ConsoleMessage.stackTrace() method
<b>Signature:</b>
```typescript
stackTrace(): ConsoleMessageLocation[];
```
<b>Returns:</b>
[ConsoleMessageLocation](./puppeteer.consolemessagelocation.md)<!-- -->\[\]
The array of locations on the stack of the console message.

View File

@ -1,17 +0,0 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [ConsoleMessage](./puppeteer.consolemessage.md) &gt; [text](./puppeteer.consolemessage.text.md)
## ConsoleMessage.text() method
<b>Signature:</b>
```typescript
text(): string;
```
<b>Returns:</b>
string
The text of the console message.

View File

@ -1,17 +0,0 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [ConsoleMessage](./puppeteer.consolemessage.md) &gt; [type](./puppeteer.consolemessage.type.md)
## ConsoleMessage.type() method
<b>Signature:</b>
```typescript
type(): ConsoleMessageType;
```
<b>Returns:</b>
[ConsoleMessageType](./puppeteer.consolemessagetype.md)
The type of the console message.

View File

@ -1,13 +0,0 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [ConsoleMessageLocation](./puppeteer.consolemessagelocation.md) &gt; [columnNumber](./puppeteer.consolemessagelocation.columnnumber.md)
## ConsoleMessageLocation.columnNumber property
0-based column number in the resource if known or `undefined` otherwise.
<b>Signature:</b>
```typescript
columnNumber?: number;
```

View File

@ -1,13 +0,0 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [ConsoleMessageLocation](./puppeteer.consolemessagelocation.md) &gt; [lineNumber](./puppeteer.consolemessagelocation.linenumber.md)
## ConsoleMessageLocation.lineNumber property
0-based line number in the resource if known or `undefined` otherwise.
<b>Signature:</b>
```typescript
lineNumber?: number;
```

View File

@ -1,21 +0,0 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [ConsoleMessageLocation](./puppeteer.consolemessagelocation.md)
## ConsoleMessageLocation interface
<b>Signature:</b>
```typescript
export interface ConsoleMessageLocation
```
## Properties
| Property | Type | Description |
| --- | --- | --- |
| [columnNumber](./puppeteer.consolemessagelocation.columnnumber.md) | number | 0-based column number in the resource if known or <code>undefined</code> otherwise. |
| [lineNumber](./puppeteer.consolemessagelocation.linenumber.md) | number | 0-based line number in the resource if known or <code>undefined</code> otherwise. |
| [url](./puppeteer.consolemessagelocation.url.md) | string | URL of the resource if known or <code>undefined</code> otherwise. |

View File

@ -1,13 +0,0 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [ConsoleMessageLocation](./puppeteer.consolemessagelocation.md) &gt; [url](./puppeteer.consolemessagelocation.url.md)
## ConsoleMessageLocation.url property
URL of the resource if known or `undefined` otherwise.
<b>Signature:</b>
```typescript
url?: string;
```

View File

@ -1,13 +0,0 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [ConsoleMessageType](./puppeteer.consolemessagetype.md)
## ConsoleMessageType type
The supported types for console messages.
<b>Signature:</b>
```typescript
export declare type ConsoleMessageType = 'log' | 'debug' | 'info' | 'error' | 'warning' | 'dir' | 'dirxml' | 'table' | 'trace' | 'clear' | 'startGroup' | 'startGroupCollapsed' | 'endGroup' | 'assert' | 'profile' | 'profileEnd' | 'count' | 'timeEnd' | 'verbose';
```

View File

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

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