chore: format docs (#8629)

This commit is contained in:
jrandolf 2022-07-05 15:41:43 +02:00 committed by GitHub
parent 9e596d0761
commit b5a345b06b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
726 changed files with 17463 additions and 15301 deletions

View File

@ -1,6 +1,3 @@
<!-- docusaurus-metadata-start -->
<!-- docusaurus-metadata-end -->
# Puppeteer
<!-- [START badges] -->

View File

@ -1,12 +1,13 @@
---
sidebar_label: API
---
# API Reference
## Classes
| Class | Description |
| --- | --- |
| --------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Accessibility](./puppeteer.accessibility.md) | 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). |
| [Browser](./puppeteer.browser.md) | 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). |
| [BrowserContext](./puppeteer.browsercontext.md) | 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. |
@ -43,7 +44,7 @@ sidebar_label: API
## Enumerations
| Enumeration | Description |
| --- | --- |
| ------------------------------------------------------------------------- | --------------------------------------------------------------------- |
| [BrowserContextEmittedEvents](./puppeteer.browsercontextemittedevents.md) | |
| [BrowserEmittedEvents](./puppeteer.browseremittedevents.md) | All the events a [browser instance](./puppeteer.browser.md) may emit. |
| [InterceptResolutionAction](./puppeteer.interceptresolutionaction.md) | |
@ -52,7 +53,7 @@ sidebar_label: API
## Functions
| Function | Description |
| --- | --- |
| -------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
| [clearCustomQueryHandlers()](./puppeteer.clearcustomqueryhandlers.md) | Clears all registered handlers. |
| [customQueryHandlerNames()](./puppeteer.customqueryhandlernames.md) | |
| [registerCustomQueryHandler(name, handler)](./puppeteer.registercustomqueryhandler.md) | Registers a [custom query handler](./puppeteer.customqueryhandler.md). |
@ -61,7 +62,7 @@ sidebar_label: API
## Interfaces
| Interface | Description |
| --- | --- |
| --------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [BoundingBox](./puppeteer.boundingbox.md) | |
| [BoxModel](./puppeteer.boxmodel.md) | |
| [BrowserConnectOptions](./puppeteer.browserconnectoptions.md) | Generic browser options that can be passed when launching any browser or when connecting to an existing browser instance. |
@ -121,14 +122,14 @@ sidebar_label: API
## Variables
| Variable | Description |
| --- | --- |
| --------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [connect](./puppeteer.connect.md) | |
| [createBrowserFetcher](./puppeteer.createbrowserfetcher.md) | |
| [DEFAULT\_INTERCEPT\_RESOLUTION\_PRIORITY](./puppeteer.default_intercept_resolution_priority.md) | The default cooperative request interception resolution priority |
| [DEFAULT_INTERCEPT_RESOLUTION_PRIORITY](./puppeteer.default_intercept_resolution_priority.md) | The default cooperative request interception resolution priority |
| [defaultArgs](./puppeteer.defaultargs.md) | |
| [devices](./puppeteer.devices.md) | A list of devices to be used with <code>page.emulate(options)</code>. Actual list of devices can be found in [src/common/DeviceDescriptors.ts](https://github.com/puppeteer/puppeteer/blob/main/src/common/DeviceDescriptors.ts). |
| [errors](./puppeteer.errors.md) | <p>Puppeteer methods might throw errors if they are unable to fulfill a request. For example, <code>page.waitForSelector(selector[, options])</code> might fail if the selector doesn't match any nodes during the given timeframe.</p><p>For certain types of errors Puppeteer uses specific error classes. These classes are available via <code>puppeteer.errors</code>.</p> |
| [EVALUATION\_SCRIPT\_URL](./puppeteer.evaluation_script_url.md) | |
| [EVALUATION_SCRIPT_URL](./puppeteer.evaluation_script_url.md) | |
| [executablePath](./puppeteer.executablepath.md) | |
| [launch](./puppeteer.launch.md) | |
| [networkConditions](./puppeteer.networkconditions.md) | A list of network conditions to be used with <code>page.emulateNetworkConditions(networkConditions)</code>. Actual list of predefined conditions can be found in [src/common/NetworkConditions.ts](https://github.com/puppeteer/puppeteer/blob/main/src/common/NetworkConditions.ts). |
@ -136,7 +137,7 @@ sidebar_label: API
## Type Aliases
| Type Alias | Description |
| --- | --- |
| ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [ActionResult](./puppeteer.actionresult.md) | |
| [Awaitable](./puppeteer.awaitable.md) | |
| [ChromeReleaseChannel](./puppeteer.chromereleasechannel.md) | |
@ -163,4 +164,3 @@ sidebar_label: API
| [PuppeteerNodeLaunchOptions](./puppeteer.puppeteernodelaunchoptions.md) | Utility type exposed to enable users to define options that can be passed to <code>puppeteer.launch</code> without having to list the set of all types. |
| [ResourceType](./puppeteer.resourcetype.md) | Resource types for HTTPRequests as perceived by the rendering engine. |
| [TargetFilterCallback](./puppeteer.targetfiltercallback.md) | |

View File

@ -1,6 +1,7 @@
---
sidebar_label: Accessibility
---
# 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).
@ -24,6 +25,5 @@ The constructor for this class is marked as internal. Third-party code should no
## 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,6 +1,7 @@
---
sidebar_label: Accessibility.snapshot
---
# Accessibility.snapshot() method
Captures the current state of the accessibility tree. The returned object represents the root accessible node of the page.
@ -8,13 +9,15 @@ Captures the current state of the accessibility tree. The returned object repres
**Signature:**
```typescript
class Accessibility {snapshot(options?: SnapshotOptions): Promise<SerializedAXNode | null>;}
class Accessibility {
snapshot(options?: SnapshotOptions): Promise<SerializedAXNode | null>;
}
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| --------- | ------------------------------------------------- | ----------------- |
| options | [SnapshotOptions](./puppeteer.snapshotoptions.md) | <i>(Optional)</i> |
**Returns:**
@ -46,8 +49,7 @@ const node = findFocusedNode(snapshot);
console.log(node && node.name);
function findFocusedNode(node) {
if (node.focused)
return node;
if (node.focused) return node;
for (const child of node.children || []) {
const foundNode = findFocusedNode(child);
return foundNode;
@ -55,4 +57,3 @@ function findFocusedNode(node) {
return null;
}
```

View File

@ -1,8 +1,8 @@
---
sidebar_label: ActionResult
---
# ActionResult type
# ActionResult type
**Signature:**

View File

@ -1,8 +1,8 @@
---
sidebar_label: Awaitable
---
# Awaitable type
# Awaitable type
**Signature:**

View File

@ -1,6 +1,7 @@
---
sidebar_label: BoundingBox.height
---
# BoundingBox.height property
the height of the element in pixels.
@ -8,5 +9,7 @@ the height of the element in pixels.
**Signature:**
```typescript
interface BoundingBox {height: number;}
interface BoundingBox {
height: number;
}
```

View File

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

View File

@ -1,6 +1,7 @@
---
sidebar_label: BoundingBox.width
---
# BoundingBox.width property
the width of the element in pixels.
@ -8,5 +9,7 @@ the width of the element in pixels.
**Signature:**
```typescript
interface BoundingBox {width: number;}
interface BoundingBox {
width: number;
}
```

View File

@ -1,10 +1,13 @@
---
sidebar_label: BoxModel.border
---
# BoxModel.border property
**Signature:**
```typescript
interface BoxModel {border: Point[];}
interface BoxModel {
border: Point[];
}
```

View File

@ -1,10 +1,13 @@
---
sidebar_label: BoxModel.content
---
# BoxModel.content property
**Signature:**
```typescript
interface BoxModel {content: Point[];}
interface BoxModel {
content: Point[];
}
```

View File

@ -1,10 +1,13 @@
---
sidebar_label: BoxModel.height
---
# BoxModel.height property
**Signature:**
```typescript
interface BoxModel {height: number;}
interface BoxModel {
height: number;
}
```

View File

@ -1,10 +1,13 @@
---
sidebar_label: BoxModel.margin
---
# BoxModel.margin property
**Signature:**
```typescript
interface BoxModel {margin: Point[];}
interface BoxModel {
margin: Point[];
}
```

View File

@ -1,8 +1,8 @@
---
sidebar_label: BoxModel
---
# BoxModel interface
# BoxModel interface
**Signature:**
@ -13,11 +13,10 @@ export interface BoxModel
## Properties
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| ------------------------------------------ | --------- | --------------------------------- | ----------- |
| [border](./puppeteer.boxmodel.border.md) | | [Point](./puppeteer.point.md)\[\] | |
| [content](./puppeteer.boxmodel.content.md) | | [Point](./puppeteer.point.md)\[\] | |
| [height](./puppeteer.boxmodel.height.md) | | number | |
| [margin](./puppeteer.boxmodel.margin.md) | | [Point](./puppeteer.point.md)\[\] | |
| [padding](./puppeteer.boxmodel.padding.md) | | [Point](./puppeteer.point.md)\[\] | |
| [width](./puppeteer.boxmodel.width.md) | | number | |

View File

@ -1,10 +1,13 @@
---
sidebar_label: BoxModel.padding
---
# BoxModel.padding property
**Signature:**
```typescript
interface BoxModel {padding: Point[];}
interface BoxModel {
padding: Point[];
}
```

View File

@ -1,10 +1,13 @@
---
sidebar_label: BoxModel.width
---
# BoxModel.width property
**Signature:**
```typescript
interface BoxModel {width: number;}
interface BoxModel {
width: number;
}
```

View File

@ -1,6 +1,7 @@
---
sidebar_label: Browser.browserContexts
---
# 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).
@ -8,9 +9,11 @@ Returns an array of all open browser contexts. In a newly created browser, this
**Signature:**
```typescript
class Browser {browserContexts(): BrowserContext[];}
class Browser {
browserContexts(): BrowserContext[];
}
```
**Returns:**
[BrowserContext](./puppeteer.browsercontext.md)\[\]

View File

@ -1,6 +1,7 @@
---
sidebar_label: Browser.close
---
# 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.
@ -8,9 +9,11 @@ Closes Chromium and all of its pages (if any were opened). The [Browser](./puppe
**Signature:**
```typescript
class Browser {close(): Promise<void>;}
class Browser {
close(): Promise<void>;
}
```
**Returns:**
Promise&lt;void&gt;

View File

@ -1,6 +1,7 @@
---
sidebar_label: Browser.createIncognitoBrowserContext
---
# Browser.createIncognitoBrowserContext() method
Creates a new incognito browser context. This won't share cookies/cache with other browser contexts.
@ -8,13 +9,17 @@ Creates a new incognito browser context. This won't share cookies/cache with oth
**Signature:**
```typescript
class Browser {createIncognitoBrowserContext(options?: BrowserContextOptions): Promise<BrowserContext>;}
class Browser {
createIncognitoBrowserContext(
options?: BrowserContextOptions
): Promise<BrowserContext>;
}
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| --------- | ------------------------------------------------------------- | ----------------- |
| options | [BrowserContextOptions](./puppeteer.browsercontextoptions.md) | <i>(Optional)</i> |
**Returns:**
@ -23,7 +28,6 @@ Promise&lt;[BrowserContext](./puppeteer.browsercontext.md)&gt;
## Example
```ts
(async () => {
const browser = await puppeteer.launch();
@ -35,4 +39,3 @@ Promise&lt;[BrowserContext](./puppeteer.browsercontext.md)&gt;
await page.goto('https://example.com');
})();
```

View File

@ -1,6 +1,7 @@
---
sidebar_label: Browser.defaultBrowserContext
---
# Browser.defaultBrowserContext() method
Returns the default browser context. The default browser context cannot be closed.
@ -8,9 +9,11 @@ Returns the default browser context. The default browser context cannot be close
**Signature:**
```typescript
class Browser {defaultBrowserContext(): BrowserContext;}
class Browser {
defaultBrowserContext(): BrowserContext;
}
```
**Returns:**
[BrowserContext](./puppeteer.browsercontext.md)

View File

@ -1,6 +1,7 @@
---
sidebar_label: Browser.disconnect
---
# 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.
@ -8,9 +9,11 @@ Disconnects Puppeteer from the browser, but leaves the Chromium process running.
**Signature:**
```typescript
class Browser {disconnect(): void;}
class Browser {
disconnect(): void;
}
```
**Returns:**
void

View File

@ -1,6 +1,7 @@
---
sidebar_label: Browser.isConnected
---
# Browser.isConnected() method
Indicates that the browser is connected.
@ -8,9 +9,11 @@ Indicates that the browser is connected.
**Signature:**
```typescript
class Browser {isConnected(): boolean;}
class Browser {
isConnected(): boolean;
}
```
**Returns:**
boolean

View File

@ -1,6 +1,7 @@
---
sidebar_label: Browser
---
# 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).
@ -10,6 +11,7 @@ A Browser is created when Puppeteer connects to a Chromium instance, either thro
```typescript
export declare class Browser extends EventEmitter
```
**Extends:** [EventEmitter](./puppeteer.eventemitter.md)
## Remarks
@ -57,7 +59,7 @@ const puppeteer = require('puppeteer');
## 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(options)](./puppeteer.browser.createincognitobrowsercontext.md) | | Creates a new incognito browser context. This won't share cookies/cache with other browser contexts. |
@ -73,4 +75,3 @@ const puppeteer = require('puppeteer');
| [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,6 +1,7 @@
---
sidebar_label: Browser.newPage
---
# Browser.newPage() method
Promise which resolves to a new [Page](./puppeteer.page.md) object. The Page is created in a default browser context.
@ -8,9 +9,11 @@ Promise which resolves to a new [Page](./puppeteer.page.md) object. The Page is
**Signature:**
```typescript
class Browser {newPage(): Promise<Page>;}
class Browser {
newPage(): Promise<Page>;
}
```
**Returns:**
Promise&lt;[Page](./puppeteer.page.md)&gt;

View File

@ -1,6 +1,7 @@
---
sidebar_label: Browser.pages
---
# Browser.pages() method
An array of all open pages inside the Browser.
@ -8,8 +9,11 @@ An array of all open pages inside the Browser.
**Signature:**
```typescript
class Browser {pages(): Promise<Page[]>;}
class Browser {
pages(): Promise<Page[]>;
}
```
**Returns:**
Promise&lt;[Page](./puppeteer.page.md)\[\]&gt;
@ -17,4 +21,3 @@ 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,6 +1,7 @@
---
sidebar_label: Browser.process
---
# Browser.process() method
The spawned browser process. Returns `null` if the browser instance was created with [Puppeteer.connect()](./puppeteer.puppeteer.connect.md).
@ -8,9 +9,11 @@ The spawned browser process. Returns `null` if the browser instance was created
**Signature:**
```typescript
class Browser {process(): ChildProcess | null;}
class Browser {
process(): ChildProcess | null;
}
```
**Returns:**
ChildProcess \| null

View File

@ -1,6 +1,7 @@
---
sidebar_label: Browser.target
---
# Browser.target() method
The target associated with the browser.
@ -8,9 +9,11 @@ The target associated with the browser.
**Signature:**
```typescript
class Browser {target(): Target;}
class Browser {
target(): Target;
}
```
**Returns:**
[Target](./puppeteer.target.md)

View File

@ -1,6 +1,7 @@
---
sidebar_label: Browser.targets
---
# 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.
@ -8,9 +9,11 @@ All active targets inside the Browser. In case of multiple browser contexts, ret
**Signature:**
```typescript
class Browser {targets(): Target[];}
class Browser {
targets(): Target[];
}
```
**Returns:**
[Target](./puppeteer.target.md)\[\]

View File

@ -1,6 +1,7 @@
---
sidebar_label: Browser.userAgent
---
# Browser.userAgent() method
The browser's original user agent. Pages can override the browser user agent with [Page.setUserAgent()](./puppeteer.page.setuseragent.md).
@ -8,9 +9,11 @@ The browser's original user agent. Pages can override the browser user agent wit
**Signature:**
```typescript
class Browser {userAgent(): Promise<string>;}
class Browser {
userAgent(): Promise<string>;
}
```
**Returns:**
Promise&lt;string&gt;

View File

@ -1,6 +1,7 @@
---
sidebar_label: Browser.version
---
# Browser.version() method
A string representing the browser name and version.
@ -8,8 +9,11 @@ A string representing the browser name and version.
**Signature:**
```typescript
class Browser {version(): Promise<string>;}
class Browser {
version(): Promise<string>;
}
```
**Returns:**
Promise&lt;string&gt;
@ -19,4 +23,3 @@ Promise&lt;string&gt;
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,6 +1,7 @@
---
sidebar_label: Browser.waitForTarget
---
# Browser.waitForTarget() method
Searches for a target in all browser contexts.
@ -8,13 +9,18 @@ Searches for a target in all browser contexts.
**Signature:**
```typescript
class Browser {waitForTarget(predicate: (x: Target) => boolean | Promise<boolean>, options?: WaitForTargetOptions): Promise<Target>;}
class Browser {
waitForTarget(
predicate: (x: Target) => boolean | Promise<boolean>,
options?: WaitForTargetOptions
): Promise<Target>;
}
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| --------- | ---------------------------------------------------------------------------- | -------------------------------------- |
| predicate | (x: [Target](./puppeteer.target.md)) =&gt; boolean \| Promise&lt;boolean&gt; | A function to be run for every target. |
| options | [WaitForTargetOptions](./puppeteer.waitfortargetoptions.md) | <i>(Optional)</i> |
@ -30,6 +36,7 @@ An example of finding a target for a page opened via `window.open`:
```ts
await page.evaluate(() => window.open('https://www.example.com/'));
const newWindowTarget = await browser.waitForTarget(target => target.url() === 'https://www.example.com/');
const newWindowTarget = await browser.waitForTarget(
target => target.url() === 'https://www.example.com/'
);
```

View File

@ -1,6 +1,7 @@
---
sidebar_label: Browser.wsEndpoint
---
# Browser.wsEndpoint() method
The browser websocket endpoint which can be used as an argument to [Puppeteer.connect()](./puppeteer.puppeteer.connect.md).
@ -8,8 +9,11 @@ The browser websocket endpoint which can be used as an argument to [Puppeteer.co
**Signature:**
```typescript
class Browser {wsEndpoint(): string;}
class Browser {
wsEndpoint(): string;
}
```
**Returns:**
string
@ -21,4 +25,3 @@ The Browser websocket url.
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,6 +1,7 @@
---
sidebar_label: BrowserConnectOptions.defaultViewport
---
# BrowserConnectOptions.defaultViewport property
Sets the viewport for each page.
@ -8,5 +9,7 @@ Sets the viewport for each page.
**Signature:**
```typescript
interface BrowserConnectOptions {defaultViewport?: Viewport | null;}
interface BrowserConnectOptions {
defaultViewport?: Viewport | null;
}
```

View File

@ -1,6 +1,7 @@
---
sidebar_label: BrowserConnectOptions.ignoreHTTPSErrors
---
# BrowserConnectOptions.ignoreHTTPSErrors property
Whether to ignore HTTPS errors during navigation.
@ -8,5 +9,7 @@ Whether to ignore HTTPS errors during navigation.
**Signature:**
```typescript
interface BrowserConnectOptions {ignoreHTTPSErrors?: boolean;}
interface BrowserConnectOptions {
ignoreHTTPSErrors?: boolean;
}
```

View File

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

View File

@ -1,6 +1,7 @@
---
sidebar_label: BrowserConnectOptions.slowMo
---
# BrowserConnectOptions.slowMo property
Slows down Puppeteer operations by the specified amount of milliseconds to aid debugging.
@ -8,5 +9,7 @@ Slows down Puppeteer operations by the specified amount of milliseconds to aid d
**Signature:**
```typescript
interface BrowserConnectOptions {slowMo?: number;}
interface BrowserConnectOptions {
slowMo?: number;
}
```

View File

@ -1,6 +1,7 @@
---
sidebar_label: BrowserConnectOptions.targetFilter
---
# BrowserConnectOptions.targetFilter property
Callback to decide if Puppeteer should connect to a given target or not.
@ -8,5 +9,7 @@ Callback to decide if Puppeteer should connect to a given target or not.
**Signature:**
```typescript
interface BrowserConnectOptions {targetFilter?: TargetFilterCallback;}
interface BrowserConnectOptions {
targetFilter?: TargetFilterCallback;
}
```

View File

@ -1,6 +1,7 @@
---
sidebar_label: BrowserContext.browser
---
# BrowserContext.browser() method
The browser this browser context belongs to.
@ -8,9 +9,11 @@ The browser this browser context belongs to.
**Signature:**
```typescript
class BrowserContext {browser(): Browser;}
class BrowserContext {
browser(): Browser;
}
```
**Returns:**
[Browser](./puppeteer.browser.md)

View File

@ -1,6 +1,7 @@
---
sidebar_label: BrowserContext.clearPermissionOverrides
---
# BrowserContext.clearPermissionOverrides() method
Clears all permission overrides for the browser context.
@ -8,19 +9,20 @@ Clears all permission overrides for the browser context.
**Signature:**
```typescript
class BrowserContext {clearPermissionOverrides(): Promise<void>;}
class BrowserContext {
clearPermissionOverrides(): Promise<void>;
}
```
**Returns:**
Promise&lt;void&gt;
## Example
```ts
const context = browser.defaultBrowserContext();
context.overridePermissions('https://example.com', ['clipboard-read']);
// do stuff ..
context.clearPermissionOverrides();
```

View File

@ -1,6 +1,7 @@
---
sidebar_label: BrowserContext.close
---
# BrowserContext.close() method
Closes the browser context. All the targets that belong to the browser context will be closed.
@ -8,8 +9,11 @@ Closes the browser context. All the targets that belong to the browser context w
**Signature:**
```typescript
class BrowserContext {close(): Promise<void>;}
class BrowserContext {
close(): Promise<void>;
}
```
**Returns:**
Promise&lt;void&gt;
@ -17,4 +21,3 @@ Promise&lt;void&gt;
## Remarks
Only incognito browser contexts can be closed.

View File

@ -1,6 +1,7 @@
---
sidebar_label: BrowserContext.isIncognito
---
# BrowserContext.isIncognito() method
Returns whether BrowserContext is incognito. The default browser context is the only non-incognito browser context.
@ -8,8 +9,11 @@ Returns whether BrowserContext is incognito. The default browser context is the
**Signature:**
```typescript
class BrowserContext {isIncognito(): boolean;}
class BrowserContext {
isIncognito(): boolean;
}
```
**Returns:**
boolean
@ -17,4 +21,3 @@ boolean
## Remarks
The default browser context cannot be closed.

View File

@ -1,6 +1,7 @@
---
sidebar_label: BrowserContext
---
# 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.
@ -10,6 +11,7 @@ BrowserContexts provide a way to operate multiple independent browser sessions.
```typescript
export declare class BrowserContext extends EventEmitter
```
**Extends:** [EventEmitter](./puppeteer.eventemitter.md)
## Remarks
@ -24,7 +26,6 @@ The constructor for this class is marked as internal. Third-party code should no
## Example
```ts
// Create a new incognito browser context
const context = await browser.createIncognitoBrowserContext();
@ -39,7 +40,7 @@ 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. |
@ -49,4 +50,3 @@ await context.close();
| [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,6 +1,7 @@
---
sidebar_label: BrowserContext.newPage
---
# BrowserContext.newPage() method
Creates a new page in the browser context.
@ -8,9 +9,11 @@ Creates a new page in the browser context.
**Signature:**
```typescript
class BrowserContext {newPage(): Promise<Page>;}
class BrowserContext {
newPage(): Promise<Page>;
}
```
**Returns:**
Promise&lt;[Page](./puppeteer.page.md)&gt;

View File

@ -1,18 +1,21 @@
---
sidebar_label: BrowserContext.overridePermissions
---
# BrowserContext.overridePermissions() method
**Signature:**
```typescript
class BrowserContext {overridePermissions(origin: string, permissions: Permission[]): Promise<void>;}
class BrowserContext {
overridePermissions(origin: string, permissions: Permission[]): Promise<void>;
}
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| ----------- | ------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
| origin | string | The origin to grant permissions to, e.g. "https://example.com". |
| permissions | [Permission](./puppeteer.permission.md)\[\] | An array of permissions to grant. All permissions that are not listed here will be automatically denied. |
@ -22,9 +25,7 @@ Promise&lt;void&gt;
## Example
```ts
const context = browser.defaultBrowserContext();
await context.overridePermissions('https://html5demos.com', ['geolocation']);
```

View File

@ -1,6 +1,7 @@
---
sidebar_label: BrowserContext.pages
---
# BrowserContext.pages() method
An array of all pages inside the browser context.
@ -8,11 +9,13 @@ An array of all pages inside the browser context.
**Signature:**
```typescript
class BrowserContext {pages(): Promise<Page[]>;}
class BrowserContext {
pages(): Promise<Page[]>;
}
```
**Returns:**
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,6 +1,7 @@
---
sidebar_label: BrowserContext.targets
---
# BrowserContext.targets() method
An array of all active targets inside the browser context.
@ -8,9 +9,11 @@ An array of all active targets inside the browser context.
**Signature:**
```typescript
class BrowserContext {targets(): Target[];}
class BrowserContext {
targets(): Target[];
}
```
**Returns:**
[Target](./puppeteer.target.md)\[\]

View File

@ -1,6 +1,7 @@
---
sidebar_label: BrowserContext.waitForTarget
---
# BrowserContext.waitForTarget() method
This searches for a target in this specific browser context.
@ -8,15 +9,20 @@ This searches for a target in this specific browser context.
**Signature:**
```typescript
class BrowserContext {waitForTarget(predicate: (x: Target) => boolean | Promise<boolean>, options?: {
class BrowserContext {
waitForTarget(
predicate: (x: Target) => boolean | Promise<boolean>,
options?: {
timeout?: number;
}): Promise<Target>;}
}
): Promise<Target>;
}
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| --------- | ---------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| predicate | (x: [Target](./puppeteer.target.md)) =&gt; boolean \| Promise&lt;boolean&gt; | A function to be run for every target |
| options | { timeout?: number; } | <i>(Optional)</i> 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. |
@ -32,6 +38,7 @@ An example of finding a target for a page opened via `window.open`:
```ts
await page.evaluate(() => window.open('https://www.example.com/'));
const newWindowTarget = await browserContext.waitForTarget(target => target.url() === 'https://www.example.com/');
const newWindowTarget = await browserContext.waitForTarget(
target => target.url() === 'https://www.example.com/'
);
```

View File

@ -1,8 +1,8 @@
---
sidebar_label: BrowserContextEmittedEvents
---
# BrowserContextEmittedEvents enum
# BrowserContextEmittedEvents enum
**Signature:**
@ -13,8 +13,7 @@ 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> | <p>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)</p><p>Contains a [Target](./puppeteer.target.md) instance.</p> |
| 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,6 +1,7 @@
---
sidebar_label: BrowserContextOptions
---
# BrowserContextOptions interface
BrowserContext options.
@ -14,7 +15,6 @@ export interface BrowserContextOptions
## Properties
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| ------------------------------------------------------------------------ | --------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| [proxyBypassList?](./puppeteer.browsercontextoptions.proxybypasslist.md) | | string\[\] | <i>(Optional)</i> Bypass the proxy for the given semi-colon-separated list of hosts. |
| [proxyServer?](./puppeteer.browsercontextoptions.proxyserver.md) | | string | <i>(Optional)</i> Proxy server with optional port to use for all requests. Username and password can be set in <code>Page.authenticate</code>. |

View File

@ -1,6 +1,7 @@
---
sidebar_label: BrowserContextOptions.proxyBypassList
---
# BrowserContextOptions.proxyBypassList property
Bypass the proxy for the given semi-colon-separated list of hosts.
@ -8,5 +9,7 @@ Bypass the proxy for the given semi-colon-separated list of hosts.
**Signature:**
```typescript
interface BrowserContextOptions {proxyBypassList?: string[];}
interface BrowserContextOptions {
proxyBypassList?: string[];
}
```

View File

@ -1,6 +1,7 @@
---
sidebar_label: BrowserContextOptions.proxyServer
---
# BrowserContextOptions.proxyServer property
Proxy server with optional port to use for all requests. Username and password can be set in `Page.authenticate`.
@ -8,5 +9,7 @@ Proxy server with optional port to use for all requests. Username and password c
**Signature:**
```typescript
interface BrowserContextOptions {proxyServer?: string;}
interface BrowserContextOptions {
proxyServer?: string;
}
```

View File

@ -1,6 +1,7 @@
---
sidebar_label: BrowserEmittedEvents
---
# BrowserEmittedEvents enum
All the events a [browser instance](./puppeteer.browser.md) may emit.
@ -14,9 +15,8 @@ export declare const enum BrowserEmittedEvents
## Enumeration Members
| Member | Value | Description |
| --- | --- | --- |
| --------------- | ---------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Disconnected | <code>&quot;disconnected&quot;</code> | <p>Emitted when Puppeteer gets disconnected from the Chromium instance. This might happen because of one of the following:</p><p>- Chromium is closed or crashed</p><p>- The [browser.disconnect](./puppeteer.browser.disconnect.md) method was called.</p> |
| 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> | <p>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)</p><p>Contains a [Target](./puppeteer.target.md) instance.</p> |
| 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,6 +1,7 @@
---
sidebar_label: BrowserFetcher.canDownload
---
# BrowserFetcher.canDownload() method
Initiates a HEAD request to check if the revision is available.
@ -8,13 +9,15 @@ Initiates a HEAD request to check if the revision is available.
**Signature:**
```typescript
class BrowserFetcher {canDownload(revision: string): Promise<boolean>;}
class BrowserFetcher {
canDownload(revision: string): Promise<boolean>;
}
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| --------- | ------ | --------------------------------------- |
| revision | string | The revision to check availability for. |
**Returns:**
@ -26,4 +29,3 @@ A promise that resolves to `true` if the revision could be downloaded from the h
## Remarks
This method is affected by the current `product`.

View File

@ -1,6 +1,7 @@
---
sidebar_label: BrowserFetcher.download
---
# BrowserFetcher.download() method
Initiates a GET request to download the revision from the host.
@ -8,13 +9,18 @@ Initiates a GET request to download the revision from the host.
**Signature:**
```typescript
class BrowserFetcher {download(revision: string, progressCallback?: (x: number, y: number) => void): Promise<BrowserFetcherRevisionInfo | undefined>;}
class BrowserFetcher {
download(
revision: string,
progressCallback?: (x: number, y: number) => void
): Promise<BrowserFetcherRevisionInfo | undefined>;
}
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| ---------------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| revision | string | The revision to download. |
| progressCallback | (x: number, y: number) =&gt; void | <i>(Optional)</i> A function that will be called with two arguments: How many bytes have been downloaded and the total number of bytes of the download. |
@ -27,4 +33,3 @@ A promise with revision information when the revision is downloaded and extracte
## Remarks
This method is affected by the current `product`.

View File

@ -1,16 +1,19 @@
---
sidebar_label: BrowserFetcher.host
---
# BrowserFetcher.host() method
**Signature:**
```typescript
class BrowserFetcher {host(): string;}
class BrowserFetcher {
host(): string;
}
```
**Returns:**
string
The download host being used.

View File

@ -1,13 +1,17 @@
---
sidebar_label: BrowserFetcher.localRevisions
---
# BrowserFetcher.localRevisions() method
**Signature:**
```typescript
class BrowserFetcher {localRevisions(): Promise<string[]>;}
class BrowserFetcher {
localRevisions(): Promise<string[]>;
}
```
**Returns:**
Promise&lt;string\[\]&gt;
@ -17,4 +21,3 @@ A promise with a list of all revision strings (for the current `product`) availa
## Remarks
This method is affected by the current `product`.

View File

@ -1,6 +1,7 @@
---
sidebar_label: BrowserFetcher
---
# BrowserFetcher class
BrowserFetcher can download and manage different versions of Chromium and Firefox.
@ -24,14 +25,17 @@ An example of using BrowserFetcher to download a specific version of Chromium an
```ts
const browserFetcher = puppeteer.createBrowserFetcher();
const revisionInfo = await browserFetcher.download('533271');
const browser = await puppeteer.launch({executablePath: revisionInfo.executablePath})
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) | | |
@ -40,4 +44,3 @@ const browser = await puppeteer.launch({executablePath: revisionInfo.executableP
| [product()](./puppeteer.browserfetcher.product.md) | | |
| [remove(revision)](./puppeteer.browserfetcher.remove.md) | | |
| [revisionInfo(revision)](./puppeteer.browserfetcher.revisioninfo.md) | | |

View File

@ -1,16 +1,19 @@
---
sidebar_label: BrowserFetcher.platform
---
# BrowserFetcher.platform() method
**Signature:**
```typescript
class BrowserFetcher {platform(): Platform;}
class BrowserFetcher {
platform(): Platform;
}
```
**Returns:**
[Platform](./puppeteer.platform.md)
Returns the current `Platform`, which is one of `mac`, `linux`, `win32` or `win64`.

View File

@ -1,16 +1,19 @@
---
sidebar_label: BrowserFetcher.product
---
# BrowserFetcher.product() method
**Signature:**
```typescript
class BrowserFetcher {product(): Product;}
class BrowserFetcher {
product(): Product;
}
```
**Returns:**
[Product](./puppeteer.product.md)
Returns the current `Product`, which is one of `chrome` or `firefox`.

View File

@ -1,18 +1,21 @@
---
sidebar_label: BrowserFetcher.remove
---
# BrowserFetcher.remove() method
**Signature:**
```typescript
class BrowserFetcher {remove(revision: string): Promise<void>;}
class BrowserFetcher {
remove(revision: string): Promise<void>;
}
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| --------- | ------ | ---------------------------------------------------------- |
| revision | string | A revision to remove for the current <code>product</code>. |
**Returns:**
@ -24,4 +27,3 @@ A promise that resolves when the revision has been removes or throws if the revi
## Remarks
This method is affected by the current `product`.

View File

@ -1,18 +1,21 @@
---
sidebar_label: BrowserFetcher.revisionInfo
---
# BrowserFetcher.revisionInfo() method
**Signature:**
```typescript
class BrowserFetcher {revisionInfo(revision: string): BrowserFetcherRevisionInfo;}
class BrowserFetcher {
revisionInfo(revision: string): BrowserFetcherRevisionInfo;
}
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| --------- | ------ | ----------------------------- |
| revision | string | The revision to get info for. |
**Returns:**
@ -20,4 +23,3 @@ class BrowserFetcher {revisionInfo(revision: string): BrowserFetcherRevisionInfo
[BrowserFetcherRevisionInfo](./puppeteer.browserfetcherrevisioninfo.md)
The revision info for the given revision.

View File

@ -1,10 +1,13 @@
---
sidebar_label: BrowserFetcherOptions.host
---
# BrowserFetcherOptions.host property
**Signature:**
```typescript
interface BrowserFetcherOptions {host?: string;}
interface BrowserFetcherOptions {
host?: string;
}
```

View File

@ -1,8 +1,8 @@
---
sidebar_label: BrowserFetcherOptions
---
# BrowserFetcherOptions interface
# BrowserFetcherOptions interface
**Signature:**
@ -13,9 +13,8 @@ export interface BrowserFetcherOptions
## Properties
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| ---------------------------------------------------------- | --------- | ----------------------------------- | ----------------- |
| [host?](./puppeteer.browserfetcheroptions.host.md) | | string | <i>(Optional)</i> |
| [path?](./puppeteer.browserfetcheroptions.path.md) | | string | <i>(Optional)</i> |
| [platform?](./puppeteer.browserfetcheroptions.platform.md) | | [Platform](./puppeteer.platform.md) | <i>(Optional)</i> |
| [product?](./puppeteer.browserfetcheroptions.product.md) | | string | <i>(Optional)</i> |

View File

@ -1,10 +1,13 @@
---
sidebar_label: BrowserFetcherOptions.path
---
# BrowserFetcherOptions.path property
**Signature:**
```typescript
interface BrowserFetcherOptions {path?: string;}
interface BrowserFetcherOptions {
path?: string;
}
```

View File

@ -1,10 +1,13 @@
---
sidebar_label: BrowserFetcherOptions.platform
---
# BrowserFetcherOptions.platform property
**Signature:**
```typescript
interface BrowserFetcherOptions {platform?: Platform;}
interface BrowserFetcherOptions {
platform?: Platform;
}
```

View File

@ -1,10 +1,13 @@
---
sidebar_label: BrowserFetcherOptions.product
---
# BrowserFetcherOptions.product property
**Signature:**
```typescript
interface BrowserFetcherOptions {product?: string;}
interface BrowserFetcherOptions {
product?: string;
}
```

View File

@ -1,10 +1,13 @@
---
sidebar_label: BrowserFetcherRevisionInfo.executablePath
---
# BrowserFetcherRevisionInfo.executablePath property
**Signature:**
```typescript
interface BrowserFetcherRevisionInfo {executablePath: string;}
interface BrowserFetcherRevisionInfo {
executablePath: string;
}
```

View File

@ -1,10 +1,13 @@
---
sidebar_label: BrowserFetcherRevisionInfo.folderPath
---
# BrowserFetcherRevisionInfo.folderPath property
**Signature:**
```typescript
interface BrowserFetcherRevisionInfo {folderPath: string;}
interface BrowserFetcherRevisionInfo {
folderPath: string;
}
```

View File

@ -1,10 +1,13 @@
---
sidebar_label: BrowserFetcherRevisionInfo.local
---
# BrowserFetcherRevisionInfo.local property
**Signature:**
```typescript
interface BrowserFetcherRevisionInfo {local: boolean;}
interface BrowserFetcherRevisionInfo {
local: boolean;
}
```

View File

@ -1,8 +1,8 @@
---
sidebar_label: BrowserFetcherRevisionInfo
---
# BrowserFetcherRevisionInfo interface
# BrowserFetcherRevisionInfo interface
**Signature:**
@ -13,11 +13,10 @@ export interface BrowserFetcherRevisionInfo
## Properties
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| -------------------------------------------------------------------------- | --------- | ------- | ----------- |
| [executablePath](./puppeteer.browserfetcherrevisioninfo.executablepath.md) | | string | |
| [folderPath](./puppeteer.browserfetcherrevisioninfo.folderpath.md) | | string | |
| [local](./puppeteer.browserfetcherrevisioninfo.local.md) | | boolean | |
| [product](./puppeteer.browserfetcherrevisioninfo.product.md) | | string | |
| [revision](./puppeteer.browserfetcherrevisioninfo.revision.md) | | string | |
| [url](./puppeteer.browserfetcherrevisioninfo.url.md) | | string | |

View File

@ -1,10 +1,13 @@
---
sidebar_label: BrowserFetcherRevisionInfo.product
---
# BrowserFetcherRevisionInfo.product property
**Signature:**
```typescript
interface BrowserFetcherRevisionInfo {product: string;}
interface BrowserFetcherRevisionInfo {
product: string;
}
```

View File

@ -1,10 +1,13 @@
---
sidebar_label: BrowserFetcherRevisionInfo.revision
---
# BrowserFetcherRevisionInfo.revision property
**Signature:**
```typescript
interface BrowserFetcherRevisionInfo {revision: string;}
interface BrowserFetcherRevisionInfo {
revision: string;
}
```

View File

@ -1,10 +1,13 @@
---
sidebar_label: BrowserFetcherRevisionInfo.url
---
# BrowserFetcherRevisionInfo.url property
**Signature:**
```typescript
interface BrowserFetcherRevisionInfo {url: string;}
interface BrowserFetcherRevisionInfo {
url: string;
}
```

View File

@ -1,6 +1,7 @@
---
sidebar_label: BrowserLaunchArgumentOptions.args
---
# BrowserLaunchArgumentOptions.args property
Additional command line arguments to pass to the browser instance.
@ -8,5 +9,7 @@ Additional command line arguments to pass to the browser instance.
**Signature:**
```typescript
interface BrowserLaunchArgumentOptions {args?: string[];}
interface BrowserLaunchArgumentOptions {
args?: string[];
}
```

View File

@ -1,10 +1,13 @@
---
sidebar_label: BrowserLaunchArgumentOptions.debuggingPort
---
# BrowserLaunchArgumentOptions.debuggingPort property
**Signature:**
```typescript
interface BrowserLaunchArgumentOptions {debuggingPort?: number;}
interface BrowserLaunchArgumentOptions {
debuggingPort?: number;
}
```

View File

@ -1,6 +1,7 @@
---
sidebar_label: BrowserLaunchArgumentOptions.devtools
---
# BrowserLaunchArgumentOptions.devtools property
Whether to auto-open a DevTools panel for each tab. If this is set to `true`, then `headless` will be forced to `false`.
@ -8,5 +9,7 @@ Whether to auto-open a DevTools panel for each tab. If this is set to `true`, th
**Signature:**
```typescript
interface BrowserLaunchArgumentOptions {devtools?: boolean;}
interface BrowserLaunchArgumentOptions {
devtools?: boolean;
}
```

View File

@ -1,6 +1,7 @@
---
sidebar_label: BrowserLaunchArgumentOptions.headless
---
# BrowserLaunchArgumentOptions.headless property
Whether to run the browser in headless mode.
@ -8,5 +9,7 @@ Whether to run the browser in headless mode.
**Signature:**
```typescript
interface BrowserLaunchArgumentOptions {headless?: boolean | 'chrome';}
interface BrowserLaunchArgumentOptions {
headless?: boolean | 'chrome';
}
```

View File

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

View File

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

View File

@ -1,14 +1,17 @@
---
sidebar_label: CDPSession.connection
---
# CDPSession.connection() method
**Signature:**
```typescript
class CDPSession {connection(): Connection | undefined;}
class CDPSession {
connection(): Connection | undefined;
}
```
**Returns:**
[Connection](./puppeteer.connection.md) \| undefined

View File

@ -1,6 +1,7 @@
---
sidebar_label: CDPSession.detach
---
# 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.
@ -8,9 +9,11 @@ Detaches the cdpSession from the target. Once detached, the cdpSession object wo
**Signature:**
```typescript
class CDPSession {detach(): Promise<void>;}
class CDPSession {
detach(): Promise<void>;
}
```
**Returns:**
Promise&lt;void&gt;

View File

@ -1,6 +1,7 @@
---
sidebar_label: CDPSession.id
---
# CDPSession.id() method
Returns the session's id.
@ -8,9 +9,11 @@ Returns the session's id.
**Signature:**
```typescript
class CDPSession {id(): string;}
class CDPSession {
id(): string;
}
```
**Returns:**
string

View File

@ -1,6 +1,7 @@
---
sidebar_label: CDPSession
---
# CDPSession class
The `CDPSession` instances are used to talk raw Chrome Devtools Protocol.
@ -10,6 +11,7 @@ The `CDPSession` instances are used to talk raw Chrome Devtools Protocol.
```typescript
export declare class CDPSession extends EventEmitter
```
**Extends:** [EventEmitter](./puppeteer.eventemitter.md)
## Remarks
@ -22,24 +24,24 @@ The constructor for this class is marked as internal. Third-party code should no
## Example
```ts
const client = await page.target().createCDPSession();
await client.send('Animation.enable');
client.on('Animation.animationCreated', () => console.log('Animation created!'));
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
playbackRate: response.playbackRate / 2,
});
```
## Methods
| Method | Modifiers | Description |
| --- | --- | --- |
| --------------------------------------------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| [connection()](./puppeteer.cdpsession.connection.md) | | |
| [detach()](./puppeteer.cdpsession.detach.md) | | Detaches the cdpSession from the target. Once detached, the cdpSession object won't emit any events and can't be used to send messages. |
| [id()](./puppeteer.cdpsession.id.md) | | Returns the session's id. |
| [send(method, paramArgs)](./puppeteer.cdpsession.send.md) | | |

View File

@ -1,22 +1,27 @@
---
sidebar_label: CDPSession.send
---
# CDPSession.send() method
**Signature:**
```typescript
class CDPSession {send<T extends keyof ProtocolMapping.Commands>(method: T, ...paramArgs: ProtocolMapping.Commands[T]['paramsType']): Promise<ProtocolMapping.Commands[T]['returnType']>;}
class CDPSession {
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'\] | |
**Returns:**
Promise&lt;ProtocolMapping.Commands\[T\]\['returnType'\]&gt;

View File

@ -1,14 +1,17 @@
---
sidebar_label: CDPSessionOnMessageObject.error
---
# CDPSessionOnMessageObject.error property
**Signature:**
```typescript
interface CDPSessionOnMessageObject {error: {
interface CDPSessionOnMessageObject {
error: {
message: string;
data: any;
code: number;
};}
};
}
```

View File

@ -1,10 +1,13 @@
---
sidebar_label: CDPSessionOnMessageObject.id
---
# CDPSessionOnMessageObject.id property
**Signature:**
```typescript
interface CDPSessionOnMessageObject {id?: number;}
interface CDPSessionOnMessageObject {
id?: number;
}
```

View File

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

View File

@ -1,10 +1,13 @@
---
sidebar_label: CDPSessionOnMessageObject.method
---
# CDPSessionOnMessageObject.method property
**Signature:**
```typescript
interface CDPSessionOnMessageObject {method: string;}
interface CDPSessionOnMessageObject {
method: string;
}
```

View File

@ -1,10 +1,13 @@
---
sidebar_label: CDPSessionOnMessageObject.params
---
# CDPSessionOnMessageObject.params property
**Signature:**
```typescript
interface CDPSessionOnMessageObject {params: Record<string, unknown>;}
interface CDPSessionOnMessageObject {
params: Record<string, unknown>;
}
```

View File

@ -1,10 +1,13 @@
---
sidebar_label: CDPSessionOnMessageObject.result
---
# CDPSessionOnMessageObject.result property
**Signature:**
```typescript
interface CDPSessionOnMessageObject {result?: any;}
interface CDPSessionOnMessageObject {
result?: any;
}
```

View File

@ -1,11 +1,15 @@
---
sidebar_label: ChromeReleaseChannel
---
# ChromeReleaseChannel type
# ChromeReleaseChannel type
**Signature:**
```typescript
export declare type ChromeReleaseChannel = 'chrome' | 'chrome-beta' | 'chrome-canary' | 'chrome-dev';
export declare type ChromeReleaseChannel =
| 'chrome'
| 'chrome-beta'
| 'chrome-canary'
| 'chrome-dev';
```

View File

@ -1,6 +1,7 @@
---
sidebar_label: clearCustomQueryHandlers
---
# clearCustomQueryHandlers() function
Clears all registered handlers.
@ -10,7 +11,7 @@ Clears all registered handlers.
```typescript
export declare function clearCustomQueryHandlers(): void;
```
**Returns:**
void

View File

@ -1,10 +1,13 @@
---
sidebar_label: ClickOptions.button
---
# ClickOptions.button property
**Signature:**
```typescript
interface ClickOptions {button?: MouseButton;}
interface ClickOptions {
button?: MouseButton;
}
```

View File

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

View File

@ -1,6 +1,7 @@
---
sidebar_label: ClickOptions.delay
---
# ClickOptions.delay property
Time to wait between `mousedown` and `mouseup` in milliseconds.
@ -8,5 +9,7 @@ Time to wait between `mousedown` and `mouseup` in milliseconds.
**Signature:**
```typescript
interface ClickOptions {delay?: number;}
interface ClickOptions {
delay?: number;
}
```

View File

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

View File

@ -1,6 +1,7 @@
---
sidebar_label: ClickOptions.offset
---
# ClickOptions.offset property
Offset for the clickable point relative to the top-left corder of the border box.
@ -8,5 +9,7 @@ Offset for the clickable point relative to the top-left corder of the border box
**Signature:**
```typescript
interface ClickOptions {offset?: Offset;}
interface ClickOptions {
offset?: Offset;
}
```

View File

@ -1,22 +1,24 @@
---
sidebar_label: CommonEventEmitter.addListener
---
# CommonEventEmitter.addListener() method
**Signature:**
```typescript
interface CommonEventEmitter {addListener(event: EventType, handler: Handler): CommonEventEmitter;}
interface CommonEventEmitter {
addListener(event: EventType, handler: Handler): CommonEventEmitter;
}
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| --------- | ------------------------------------- | ----------- |
| event | [EventType](./puppeteer.eventtype.md) | |
| handler | [Handler](./puppeteer.handler.md) | |
**Returns:**
[CommonEventEmitter](./puppeteer.commoneventemitter.md)

View File

@ -1,22 +1,24 @@
---
sidebar_label: CommonEventEmitter.emit
---
# CommonEventEmitter.emit() method
**Signature:**
```typescript
interface CommonEventEmitter {emit(event: EventType, eventData?: unknown): boolean;}
interface CommonEventEmitter {
emit(event: EventType, eventData?: unknown): boolean;
}
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| --------- | ------------------------------------- | ----------------- |
| event | [EventType](./puppeteer.eventtype.md) | |
| eventData | unknown | <i>(Optional)</i> |
**Returns:**
boolean

View File

@ -1,21 +1,23 @@
---
sidebar_label: CommonEventEmitter.listenerCount
---
# CommonEventEmitter.listenerCount() method
**Signature:**
```typescript
interface CommonEventEmitter {listenerCount(event: string): number;}
interface CommonEventEmitter {
listenerCount(event: string): number;
}
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| --------- | ------ | ----------- |
| event | string | |
**Returns:**
number

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