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:
parent
e655bb6ca2
commit
637a1f7409
1
.gitignore
vendored
1
.gitignore
vendored
@ -18,3 +18,4 @@ test/coverage.json
|
||||
temp/
|
||||
dependency-chart.png
|
||||
puppeteer-core-*.tgz
|
||||
new-docs/
|
||||
|
@ -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
|
||||
|
@ -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) | |
|
||||
|
@ -1,30 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [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. |
|
||||
|
@ -1,61 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [Accessibility](./puppeteer.accessibility.md) > [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<[SerializedAXNode](./puppeteer.serializedaxnode.md)<!-- -->>
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
```
|
||||
|
@ -1,13 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [BoundingBox](./puppeteer.boundingbox.md) > [height](./puppeteer.boundingbox.height.md)
|
||||
|
||||
## BoundingBox.height property
|
||||
|
||||
the height of the element in pixels.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
height: number;
|
||||
```
|
@ -1,22 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [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. |
|
||||
|
@ -1,13 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [BoundingBox](./puppeteer.boundingbox.md) > [width](./puppeteer.boundingbox.width.md)
|
||||
|
||||
## BoundingBox.width property
|
||||
|
||||
the width of the element in pixels.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
width: number;
|
||||
```
|
@ -1,13 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [BoundingBox](./puppeteer.boundingbox.md) > [x](./puppeteer.boundingbox.x.md)
|
||||
|
||||
## BoundingBox.x property
|
||||
|
||||
the x coordinate of the element in pixels.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
x: number;
|
||||
```
|
@ -1,13 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [BoundingBox](./puppeteer.boundingbox.md) > [y](./puppeteer.boundingbox.y.md)
|
||||
|
||||
## BoundingBox.y property
|
||||
|
||||
the y coordinate of the element in pixels.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
y: number;
|
||||
```
|
@ -1,14 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [BoxModel](./puppeteer.boxmodel.md) > [border](./puppeteer.boxmodel.border.md)
|
||||
|
||||
## BoxModel.border property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
border: Array<{
|
||||
x: number;
|
||||
y: number;
|
||||
}>;
|
||||
```
|
@ -1,14 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [BoxModel](./puppeteer.boxmodel.md) > [content](./puppeteer.boxmodel.content.md)
|
||||
|
||||
## BoxModel.content property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
content: Array<{
|
||||
x: number;
|
||||
y: number;
|
||||
}>;
|
||||
```
|
@ -1,11 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [BoxModel](./puppeteer.boxmodel.md) > [height](./puppeteer.boxmodel.height.md)
|
||||
|
||||
## BoxModel.height property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
height: number;
|
||||
```
|
@ -1,14 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [BoxModel](./puppeteer.boxmodel.md) > [margin](./puppeteer.boxmodel.margin.md)
|
||||
|
||||
## BoxModel.margin property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
margin: Array<{
|
||||
x: number;
|
||||
y: number;
|
||||
}>;
|
||||
```
|
@ -1,23 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [BoxModel](./puppeteer.boxmodel.md)
|
||||
|
||||
## BoxModel interface
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export interface BoxModel
|
||||
```
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| [border](./puppeteer.boxmodel.border.md) | Array<{ x: number; y: number; }> | |
|
||||
| [content](./puppeteer.boxmodel.content.md) | Array<{ x: number; y: number; }> | |
|
||||
| [height](./puppeteer.boxmodel.height.md) | number | |
|
||||
| [margin](./puppeteer.boxmodel.margin.md) | Array<{ x: number; y: number; }> | |
|
||||
| [padding](./puppeteer.boxmodel.padding.md) | Array<{ x: number; y: number; }> | |
|
||||
| [width](./puppeteer.boxmodel.width.md) | number | |
|
||||
|
@ -1,14 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [BoxModel](./puppeteer.boxmodel.md) > [padding](./puppeteer.boxmodel.padding.md)
|
||||
|
||||
## BoxModel.padding property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
padding: Array<{
|
||||
x: number;
|
||||
y: number;
|
||||
}>;
|
||||
```
|
@ -1,11 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [BoxModel](./puppeteer.boxmodel.md) > [width](./puppeteer.boxmodel.width.md)
|
||||
|
||||
## BoxModel.width property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
width: number;
|
||||
```
|
@ -1,17 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [Browser](./puppeteer.browser.md) > [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)<!-- -->\[\]
|
||||
|
@ -1,17 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [Browser](./puppeteer.browser.md) > [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<void>
|
||||
|
@ -1,33 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [Browser](./puppeteer.browser.md) > [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<[BrowserContext](./puppeteer.browsercontext.md)<!-- -->>
|
||||
|
||||
## 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');
|
||||
})();
|
||||
|
||||
```
|
||||
|
@ -1,17 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [Browser](./puppeteer.browser.md) > [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)
|
||||
|
@ -1,17 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [Browser](./puppeteer.browser.md) > [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
|
||||
|
@ -1,17 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [Browser](./puppeteer.browser.md) > [isConnected](./puppeteer.browser.isconnected.md)
|
||||
|
||||
## Browser.isConnected() method
|
||||
|
||||
Indicates that the browser is connected.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
isConnected(): boolean;
|
||||
```
|
||||
<b>Returns:</b>
|
||||
|
||||
boolean
|
||||
|
@ -1,79 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [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)<!-- -->. |
|
||||
|
@ -1,17 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [Browser](./puppeteer.browser.md) > [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<[Page](./puppeteer.page.md)<!-- -->>
|
||||
|
@ -1,21 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [Browser](./puppeteer.browser.md) > [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<[Page](./puppeteer.page.md)<!-- -->\[\]>
|
||||
|
||||
## 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)<!-- -->.
|
||||
|
@ -1,17 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [Browser](./puppeteer.browser.md) > [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
|
||||
|
@ -1,17 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [Browser](./puppeteer.browser.md) > [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)
|
||||
|
@ -1,17 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [Browser](./puppeteer.browser.md) > [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)<!-- -->\[\]
|
||||
|
@ -1,17 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [Browser](./puppeteer.browser.md) > [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<string>
|
||||
|
@ -1,23 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [Browser](./puppeteer.browser.md) > [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<string>
|
||||
|
||||
## 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.
|
||||
|
@ -1,37 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [Browser](./puppeteer.browser.md) > [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)<!-- -->) => boolean | A function to be run for every target. |
|
||||
| options | [WaitForTargetOptions](./puppeteer.waitfortargetoptions.md) | |
|
||||
|
||||
<b>Returns:</b>
|
||||
|
||||
Promise<[Target](./puppeteer.target.md)<!-- -->>
|
||||
|
||||
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/');
|
||||
|
||||
```
|
||||
|
@ -1,25 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [Browser](./puppeteer.browser.md) > [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)<!-- -->.
|
||||
|
@ -1,17 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserContext](./puppeteer.browsercontext.md) > [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)
|
||||
|
@ -1,28 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserContext](./puppeteer.browsercontext.md) > [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<void>
|
||||
|
||||
## Example
|
||||
|
||||
|
||||
```js
|
||||
const context = browser.defaultBrowserContext();
|
||||
context.overridePermissions('https://example.com', ['clipboard-read']);
|
||||
// do stuff ..
|
||||
context.clearPermissionOverrides();
|
||||
|
||||
```
|
||||
|
@ -1,21 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserContext](./puppeteer.browsercontext.md) > [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<void>
|
||||
|
||||
## Remarks
|
||||
|
||||
Only incognito browser contexts can be closed.
|
||||
|
@ -1,21 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserContext](./puppeteer.browsercontext.md) > [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.
|
||||
|
@ -1,54 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [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. |
|
||||
|
@ -1,17 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserContext](./puppeteer.browsercontext.md) > [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<[Page](./puppeteer.page.md)<!-- -->>
|
||||
|
@ -1,32 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserContext](./puppeteer.browsercontext.md) > [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<void>
|
||||
|
||||
## Example
|
||||
|
||||
|
||||
```js
|
||||
const context = browser.defaultBrowserContext();
|
||||
await context.overridePermissions('https://html5demos.com', ['geolocation']);
|
||||
|
||||
```
|
||||
|
@ -1,19 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserContext](./puppeteer.browsercontext.md) > [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<[Page](./puppeteer.page.md)<!-- -->\[\]>
|
||||
|
||||
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)<!-- -->.
|
||||
|
@ -1,17 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserContext](./puppeteer.browsercontext.md) > [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)<!-- -->\[\]
|
||||
|
@ -1,39 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserContext](./puppeteer.browsercontext.md) > [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)<!-- -->) => 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<[Target](./puppeteer.target.md)<!-- -->>
|
||||
|
||||
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/');
|
||||
|
||||
```
|
||||
|
@ -1,20 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserContextEmittedEvents](./puppeteer.browsercontextemittedevents.md)
|
||||
|
||||
## BrowserContextEmittedEvents enum
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export declare const enum BrowserContextEmittedEvents
|
||||
```
|
||||
|
||||
## Enumeration Members
|
||||
|
||||
| Member | Value | Description |
|
||||
| --- | --- | --- |
|
||||
| TargetChanged | <code>"targetchanged"</code> | Emitted when the url of a target inside the browser context changes. Contains a [Target](./puppeteer.target.md) instance. |
|
||||
| TargetCreated | <code>"targetcreated"</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>"targetdestroyed"</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. |
|
||||
|
@ -1,23 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [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>"disconnected"</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>"targetchanged"</code> | Emitted when the url of a target changes. Contains a [Target](./puppeteer.target.md) instance. |
|
||||
| TargetCreated | <code>"targetcreated"</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>"targetdestroyed"</code> | Emitted when a target is destroyed, for example when a page is closed. Contains a [Target](./puppeteer.target.md) instance. |
|
||||
|
@ -1,30 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserFetcher](./puppeteer.browserfetcher.md) > [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<boolean>
|
||||
|
||||
A promise that resolves to `true` if the revision could be downloaded from the host.
|
||||
|
||||
## Remarks
|
||||
|
||||
This method is affected by the current `product`<!-- -->.
|
||||
|
@ -1,31 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserFetcher](./puppeteer.browserfetcher.md) > [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) => 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<[BrowserFetcherRevisionInfo](./puppeteer.browserfetcherrevisioninfo.md)<!-- -->>
|
||||
|
||||
A promise with revision information when the revision is downloaded and extracted.
|
||||
|
||||
## Remarks
|
||||
|
||||
This method is affected by the current `product`<!-- -->.
|
||||
|
@ -1,17 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserFetcher](./puppeteer.browserfetcher.md) > [host](./puppeteer.browserfetcher.host.md)
|
||||
|
||||
## BrowserFetcher.host() method
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
host(): string;
|
||||
```
|
||||
<b>Returns:</b>
|
||||
|
||||
string
|
||||
|
||||
The download host being used.
|
||||
|
@ -1,21 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserFetcher](./puppeteer.browserfetcher.md) > [localRevisions](./puppeteer.browserfetcher.localrevisions.md)
|
||||
|
||||
## BrowserFetcher.localRevisions() method
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
localRevisions(): Promise<string[]>;
|
||||
```
|
||||
<b>Returns:</b>
|
||||
|
||||
Promise<string\[\]>
|
||||
|
||||
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`<!-- -->.
|
||||
|
@ -1,45 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [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) | | |
|
||||
|
@ -1,17 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserFetcher](./puppeteer.browserfetcher.md) > [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`<!-- -->.
|
||||
|
@ -1,17 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserFetcher](./puppeteer.browserfetcher.md) > [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`<!-- -->.
|
||||
|
@ -1,28 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserFetcher](./puppeteer.browserfetcher.md) > [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<void>
|
||||
|
||||
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`<!-- -->.
|
||||
|
@ -1,24 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserFetcher](./puppeteer.browserfetcher.md) > [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.
|
||||
|
@ -1,11 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserFetcherOptions](./puppeteer.browserfetcheroptions.md) > [host](./puppeteer.browserfetcheroptions.host.md)
|
||||
|
||||
## BrowserFetcherOptions.host property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
host?: string;
|
||||
```
|
@ -1,22 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [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 | |
|
||||
|
@ -1,11 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserFetcherOptions](./puppeteer.browserfetcheroptions.md) > [path](./puppeteer.browserfetcheroptions.path.md)
|
||||
|
||||
## BrowserFetcherOptions.path property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
path?: string;
|
||||
```
|
@ -1,11 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserFetcherOptions](./puppeteer.browserfetcheroptions.md) > [platform](./puppeteer.browserfetcheroptions.platform.md)
|
||||
|
||||
## BrowserFetcherOptions.platform property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
platform?: Platform;
|
||||
```
|
@ -1,11 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserFetcherOptions](./puppeteer.browserfetcheroptions.md) > [product](./puppeteer.browserfetcheroptions.product.md)
|
||||
|
||||
## BrowserFetcherOptions.product property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
product?: string;
|
||||
```
|
@ -1,11 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserFetcherRevisionInfo](./puppeteer.browserfetcherrevisioninfo.md) > [executablePath](./puppeteer.browserfetcherrevisioninfo.executablepath.md)
|
||||
|
||||
## BrowserFetcherRevisionInfo.executablePath property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
executablePath: string;
|
||||
```
|
@ -1,11 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserFetcherRevisionInfo](./puppeteer.browserfetcherrevisioninfo.md) > [folderPath](./puppeteer.browserfetcherrevisioninfo.folderpath.md)
|
||||
|
||||
## BrowserFetcherRevisionInfo.folderPath property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
folderPath: string;
|
||||
```
|
@ -1,11 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserFetcherRevisionInfo](./puppeteer.browserfetcherrevisioninfo.md) > [local](./puppeteer.browserfetcherrevisioninfo.local.md)
|
||||
|
||||
## BrowserFetcherRevisionInfo.local property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
local: boolean;
|
||||
```
|
@ -1,24 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [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 | |
|
||||
|
@ -1,11 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserFetcherRevisionInfo](./puppeteer.browserfetcherrevisioninfo.md) > [product](./puppeteer.browserfetcherrevisioninfo.product.md)
|
||||
|
||||
## BrowserFetcherRevisionInfo.product property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
product: string;
|
||||
```
|
@ -1,11 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserFetcherRevisionInfo](./puppeteer.browserfetcherrevisioninfo.md) > [revision](./puppeteer.browserfetcherrevisioninfo.revision.md)
|
||||
|
||||
## BrowserFetcherRevisionInfo.revision property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
revision: string;
|
||||
```
|
@ -1,11 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserFetcherRevisionInfo](./puppeteer.browserfetcherrevisioninfo.md) > [url](./puppeteer.browserfetcherrevisioninfo.url.md)
|
||||
|
||||
## BrowserFetcherRevisionInfo.url property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
url: string;
|
||||
```
|
@ -1,11 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserOptions](./puppeteer.browseroptions.md) > [defaultViewport](./puppeteer.browseroptions.defaultviewport.md)
|
||||
|
||||
## BrowserOptions.defaultViewport property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
defaultViewport?: Viewport;
|
||||
```
|
@ -1,11 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserOptions](./puppeteer.browseroptions.md) > [ignoreHTTPSErrors](./puppeteer.browseroptions.ignorehttpserrors.md)
|
||||
|
||||
## BrowserOptions.ignoreHTTPSErrors property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
ignoreHTTPSErrors?: boolean;
|
||||
```
|
@ -1,22 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [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 | |
|
||||
|
@ -1,11 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserOptions](./puppeteer.browseroptions.md) > [slowMo](./puppeteer.browseroptions.slowmo.md)
|
||||
|
||||
## BrowserOptions.slowMo property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
slowMo?: number;
|
||||
```
|
@ -1,17 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [CDPSession](./puppeteer.cdpsession.md) > [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<void>
|
||||
|
@ -1,45 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [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) | | |
|
||||
|
@ -1,23 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [CDPSession](./puppeteer.cdpsession.md) > [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<ProtocolMapping.Commands\[T\]\['returnType'\]>
|
||||
|
@ -1,11 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [ChromeArgOptions](./puppeteer.chromeargoptions.md) > [args](./puppeteer.chromeargoptions.args.md)
|
||||
|
||||
## ChromeArgOptions.args property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
args?: string[];
|
||||
```
|
@ -1,11 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [ChromeArgOptions](./puppeteer.chromeargoptions.md) > [devtools](./puppeteer.chromeargoptions.devtools.md)
|
||||
|
||||
## ChromeArgOptions.devtools property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
devtools?: boolean;
|
||||
```
|
@ -1,11 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [ChromeArgOptions](./puppeteer.chromeargoptions.md) > [headless](./puppeteer.chromeargoptions.headless.md)
|
||||
|
||||
## ChromeArgOptions.headless property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
headless?: boolean;
|
||||
```
|
@ -1,23 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [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 | |
|
||||
|
@ -1,11 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [ChromeArgOptions](./puppeteer.chromeargoptions.md) > [userDataDir](./puppeteer.chromeargoptions.userdatadir.md)
|
||||
|
||||
## ChromeArgOptions.userDataDir property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
userDataDir?: string;
|
||||
```
|
@ -1,11 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [ClickOptions](./puppeteer.clickoptions.md) > [button](./puppeteer.clickoptions.button.md)
|
||||
|
||||
## ClickOptions.button property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
button?: 'left' | 'right' | 'middle';
|
||||
```
|
@ -1,11 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [ClickOptions](./puppeteer.clickoptions.md) > [clickCount](./puppeteer.clickoptions.clickcount.md)
|
||||
|
||||
## ClickOptions.clickCount property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
clickCount?: number;
|
||||
```
|
@ -1,13 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [ClickOptions](./puppeteer.clickoptions.md) > [delay](./puppeteer.clickoptions.delay.md)
|
||||
|
||||
## ClickOptions.delay property
|
||||
|
||||
Time to wait between `mousedown` and `mouseup` in milliseconds.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
delay?: number;
|
||||
```
|
@ -1,21 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [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. |
|
||||
|
@ -1,11 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [ConnectOptions](./puppeteer.connectoptions.md) > [browserURL](./puppeteer.connectoptions.browserurl.md)
|
||||
|
||||
## ConnectOptions.browserURL property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
browserURL?: string;
|
||||
```
|
@ -1,11 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [ConnectOptions](./puppeteer.connectoptions.md) > [browserWSEndpoint](./puppeteer.connectoptions.browserwsendpoint.md)
|
||||
|
||||
## ConnectOptions.browserWSEndpoint property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
browserWSEndpoint?: string;
|
||||
```
|
@ -1,22 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [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 | |
|
||||
|
@ -1,11 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [ConnectOptions](./puppeteer.connectoptions.md) > [product](./puppeteer.connectoptions.product.md)
|
||||
|
||||
## ConnectOptions.product property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
product?: Product;
|
||||
```
|
@ -1,11 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [ConnectOptions](./puppeteer.connectoptions.md) > [transport](./puppeteer.connectoptions.transport.md)
|
||||
|
||||
## ConnectOptions.transport property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
transport?: ConnectionTransport;
|
||||
```
|
@ -1,23 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [ConsoleMessage](./puppeteer.consolemessage.md) > [(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)<!-- -->\[\] | |
|
||||
|
@ -1,17 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [ConsoleMessage](./puppeteer.consolemessage.md) > [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.
|
||||
|
@ -1,17 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [ConsoleMessage](./puppeteer.consolemessage.md) > [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.
|
||||
|
@ -1,30 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [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) | | |
|
||||
|
@ -1,17 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [ConsoleMessage](./puppeteer.consolemessage.md) > [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.
|
||||
|
@ -1,17 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [ConsoleMessage](./puppeteer.consolemessage.md) > [text](./puppeteer.consolemessage.text.md)
|
||||
|
||||
## ConsoleMessage.text() method
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
text(): string;
|
||||
```
|
||||
<b>Returns:</b>
|
||||
|
||||
string
|
||||
|
||||
The text of the console message.
|
||||
|
@ -1,17 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [ConsoleMessage](./puppeteer.consolemessage.md) > [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.
|
||||
|
@ -1,13 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [ConsoleMessageLocation](./puppeteer.consolemessagelocation.md) > [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;
|
||||
```
|
@ -1,13 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [ConsoleMessageLocation](./puppeteer.consolemessagelocation.md) > [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;
|
||||
```
|
@ -1,21 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [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. |
|
||||
|
@ -1,13 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [ConsoleMessageLocation](./puppeteer.consolemessagelocation.md) > [url](./puppeteer.consolemessagelocation.url.md)
|
||||
|
||||
## ConsoleMessageLocation.url property
|
||||
|
||||
URL of the resource if known or `undefined` otherwise.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
url?: string;
|
||||
```
|
@ -1,13 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [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';
|
||||
```
|
@ -1,11 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [ContinueRequestOverrides](./puppeteer.continuerequestoverrides.md) > [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
Loading…
Reference in New Issue
Block a user