mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
chore: remove docusaurus metadata from README.md (#8624)
This commit is contained in:
parent
fc77c1517f
commit
45eb2c607f
11
.gitignore
vendored
11
.gitignore
vendored
@ -2,19 +2,18 @@
|
|||||||
node_modules
|
node_modules
|
||||||
|
|
||||||
# Production
|
# Production
|
||||||
build
|
build/
|
||||||
lib
|
lib/
|
||||||
|
|
||||||
# Generated files
|
# Generated files
|
||||||
coverage
|
|
||||||
tsconfig.tsbuildinfo
|
tsconfig.tsbuildinfo
|
||||||
puppeteer.api.json
|
puppeteer.api.json
|
||||||
puppeteer*.tgz
|
puppeteer*.tgz
|
||||||
yarn.lock
|
yarn.lock
|
||||||
.docusaurus
|
.docusaurus/
|
||||||
.cache-loader
|
.cache-loader
|
||||||
.local-chromium
|
.local-chromium/
|
||||||
.local-firefox
|
.local-firefox/
|
||||||
test/output-*/
|
test/output-*/
|
||||||
.dev_profile*
|
.dev_profile*
|
||||||
|
|
||||||
|
@ -1,17 +1,44 @@
|
|||||||
|
# Keep in sync with .gitignore
|
||||||
|
|
||||||
|
# Dependencies
|
||||||
|
node_modules
|
||||||
|
|
||||||
|
# Production
|
||||||
|
build/
|
||||||
|
lib/
|
||||||
|
|
||||||
|
# Generated files
|
||||||
|
tsconfig.tsbuildinfo
|
||||||
|
puppeteer.api.json
|
||||||
|
puppeteer*.tgz
|
||||||
|
yarn.lock
|
||||||
|
.docusaurus/
|
||||||
|
.cache-loader
|
||||||
.local-chromium/
|
.local-chromium/
|
||||||
.local-firefox/
|
.local-firefox/
|
||||||
|
test/output-*/
|
||||||
|
.dev_profile*
|
||||||
|
|
||||||
|
# IDE Artifacts
|
||||||
|
.vscode
|
||||||
|
|
||||||
|
# Misc
|
||||||
|
.DS_Store
|
||||||
|
.env.local
|
||||||
|
.env.development.local
|
||||||
|
.env.test.local
|
||||||
|
.env.production.local
|
||||||
|
|
||||||
|
npm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
|
||||||
|
# Prettier-only ignores.
|
||||||
assets/
|
assets/
|
||||||
build/
|
|
||||||
CHANGELOG.md
|
CHANGELOG.md
|
||||||
coverage/
|
|
||||||
lib/
|
|
||||||
node_modules/
|
|
||||||
package-lock.json
|
package-lock.json
|
||||||
package.json
|
package.json
|
||||||
test/assets/
|
test/assets/
|
||||||
tsconfig.tsbuildinfo
|
|
||||||
vendor/
|
vendor/
|
||||||
yarn.lock
|
|
||||||
puppeteer.api.json
|
|
||||||
website/
|
|
||||||
docs/
|
docs/
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
---
|
<!-- docusaurus-metadata-start -->
|
||||||
sidebar_position: 1
|
<!-- docusaurus-metadata-end -->
|
||||||
---
|
|
||||||
|
|
||||||
# Puppeteer
|
# Puppeteer
|
||||||
|
|
||||||
|
@ -1,13 +1,12 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: API
|
sidebar_label: API
|
||||||
---
|
---
|
||||||
|
|
||||||
# API Reference
|
# API Reference
|
||||||
|
|
||||||
## Classes
|
## Classes
|
||||||
|
|
||||||
| Class | Description |
|
| 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). |
|
| [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). |
|
| [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. |
|
| [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. |
|
||||||
@ -44,7 +43,7 @@ sidebar_label: API
|
|||||||
## Enumerations
|
## Enumerations
|
||||||
|
|
||||||
| Enumeration | Description |
|
| Enumeration | Description |
|
||||||
| ------------------------------------------------------------------------- | --------------------------------------------------------------------- |
|
| --- | --- |
|
||||||
| [BrowserContextEmittedEvents](./puppeteer.browsercontextemittedevents.md) | |
|
| [BrowserContextEmittedEvents](./puppeteer.browsercontextemittedevents.md) | |
|
||||||
| [BrowserEmittedEvents](./puppeteer.browseremittedevents.md) | All the events a [browser instance](./puppeteer.browser.md) may emit. |
|
| [BrowserEmittedEvents](./puppeteer.browseremittedevents.md) | All the events a [browser instance](./puppeteer.browser.md) may emit. |
|
||||||
| [InterceptResolutionAction](./puppeteer.interceptresolutionaction.md) | |
|
| [InterceptResolutionAction](./puppeteer.interceptresolutionaction.md) | |
|
||||||
@ -53,7 +52,7 @@ sidebar_label: API
|
|||||||
## Functions
|
## Functions
|
||||||
|
|
||||||
| Function | Description |
|
| Function | Description |
|
||||||
| -------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
|
| --- | --- |
|
||||||
| [clearCustomQueryHandlers()](./puppeteer.clearcustomqueryhandlers.md) | Clears all registered handlers. |
|
| [clearCustomQueryHandlers()](./puppeteer.clearcustomqueryhandlers.md) | Clears all registered handlers. |
|
||||||
| [customQueryHandlerNames()](./puppeteer.customqueryhandlernames.md) | |
|
| [customQueryHandlerNames()](./puppeteer.customqueryhandlernames.md) | |
|
||||||
| [registerCustomQueryHandler(name, handler)](./puppeteer.registercustomqueryhandler.md) | Registers a [custom query handler](./puppeteer.customqueryhandler.md). |
|
| [registerCustomQueryHandler(name, handler)](./puppeteer.registercustomqueryhandler.md) | Registers a [custom query handler](./puppeteer.customqueryhandler.md). |
|
||||||
@ -62,7 +61,7 @@ sidebar_label: API
|
|||||||
## Interfaces
|
## Interfaces
|
||||||
|
|
||||||
| Interface | Description |
|
| Interface | Description |
|
||||||
| --------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| --- | --- |
|
||||||
| [BoundingBox](./puppeteer.boundingbox.md) | |
|
| [BoundingBox](./puppeteer.boundingbox.md) | |
|
||||||
| [BoxModel](./puppeteer.boxmodel.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. |
|
| [BrowserConnectOptions](./puppeteer.browserconnectoptions.md) | Generic browser options that can be passed when launching any browser or when connecting to an existing browser instance. |
|
||||||
@ -122,14 +121,14 @@ sidebar_label: API
|
|||||||
## Variables
|
## Variables
|
||||||
|
|
||||||
| Variable | Description |
|
| Variable | Description |
|
||||||
| --------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| --- | --- |
|
||||||
| [connect](./puppeteer.connect.md) | |
|
| [connect](./puppeteer.connect.md) | |
|
||||||
| [createBrowserFetcher](./puppeteer.createbrowserfetcher.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) | |
|
| [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). |
|
| [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> |
|
| [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) | |
|
| [executablePath](./puppeteer.executablepath.md) | |
|
||||||
| [launch](./puppeteer.launch.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). |
|
| [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). |
|
||||||
@ -137,7 +136,7 @@ sidebar_label: API
|
|||||||
## Type Aliases
|
## Type Aliases
|
||||||
|
|
||||||
| Type Alias | Description |
|
| Type Alias | Description |
|
||||||
| ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| --- | --- |
|
||||||
| [ActionResult](./puppeteer.actionresult.md) | |
|
| [ActionResult](./puppeteer.actionresult.md) | |
|
||||||
| [Awaitable](./puppeteer.awaitable.md) | |
|
| [Awaitable](./puppeteer.awaitable.md) | |
|
||||||
| [ChromeReleaseChannel](./puppeteer.chromereleasechannel.md) | |
|
| [ChromeReleaseChannel](./puppeteer.chromereleasechannel.md) | |
|
||||||
@ -164,3 +163,4 @@ 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. |
|
| [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. |
|
| [ResourceType](./puppeteer.resourcetype.md) | Resource types for HTTPRequests as perceived by the rendering engine. |
|
||||||
| [TargetFilterCallback](./puppeteer.targetfiltercallback.md) | |
|
| [TargetFilterCallback](./puppeteer.targetfiltercallback.md) | |
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: Accessibility
|
sidebar_label: Accessibility
|
||||||
---
|
---
|
||||||
|
|
||||||
# Accessibility class
|
# 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).
|
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).
|
||||||
@ -25,5 +24,6 @@ The constructor for this class is marked as internal. Third-party code should no
|
|||||||
## Methods
|
## Methods
|
||||||
|
|
||||||
| Method | Modifiers | Description |
|
| 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. |
|
| [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,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: Accessibility.snapshot
|
sidebar_label: Accessibility.snapshot
|
||||||
---
|
---
|
||||||
|
|
||||||
# Accessibility.snapshot() method
|
# Accessibility.snapshot() method
|
||||||
|
|
||||||
Captures the current state of the accessibility tree. The returned object represents the root accessible node of the page.
|
Captures the current state of the accessibility tree. The returned object represents the root accessible node of the page.
|
||||||
@ -9,15 +8,13 @@ Captures the current state of the accessibility tree. The returned object repres
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
class Accessibility {
|
class Accessibility {snapshot(options?: SnapshotOptions): Promise<SerializedAXNode | null>;}
|
||||||
snapshot(options?: SnapshotOptions): Promise<SerializedAXNode | null>;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Parameters
|
## Parameters
|
||||||
|
|
||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| --------- | ------------------------------------------------- | ----------------- |
|
| --- | --- | --- |
|
||||||
| options | [SnapshotOptions](./puppeteer.snapshotoptions.md) | <i>(Optional)</i> |
|
| options | [SnapshotOptions](./puppeteer.snapshotoptions.md) | <i>(Optional)</i> |
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
@ -49,7 +46,8 @@ const node = findFocusedNode(snapshot);
|
|||||||
console.log(node && node.name);
|
console.log(node && node.name);
|
||||||
|
|
||||||
function findFocusedNode(node) {
|
function findFocusedNode(node) {
|
||||||
if (node.focused) return node;
|
if (node.focused)
|
||||||
|
return node;
|
||||||
for (const child of node.children || []) {
|
for (const child of node.children || []) {
|
||||||
const foundNode = findFocusedNode(child);
|
const foundNode = findFocusedNode(child);
|
||||||
return foundNode;
|
return foundNode;
|
||||||
@ -57,3 +55,4 @@ function findFocusedNode(node) {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: ActionResult
|
sidebar_label: ActionResult
|
||||||
---
|
---
|
||||||
|
|
||||||
# ActionResult type
|
# ActionResult type
|
||||||
|
|
||||||
|
|
||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: Awaitable
|
sidebar_label: Awaitable
|
||||||
---
|
---
|
||||||
|
|
||||||
# Awaitable type
|
# Awaitable type
|
||||||
|
|
||||||
|
|
||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: BoundingBox.height
|
sidebar_label: BoundingBox.height
|
||||||
---
|
---
|
||||||
|
|
||||||
# BoundingBox.height property
|
# BoundingBox.height property
|
||||||
|
|
||||||
the height of the element in pixels.
|
the height of the element in pixels.
|
||||||
@ -9,7 +8,5 @@ the height of the element in pixels.
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
interface BoundingBox {
|
interface BoundingBox {height: number;}
|
||||||
height: number;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
@ -1,20 +1,20 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: BoundingBox
|
sidebar_label: BoundingBox
|
||||||
---
|
---
|
||||||
|
|
||||||
# BoundingBox interface
|
# BoundingBox interface
|
||||||
|
|
||||||
|
|
||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
export interface BoundingBox extends Point
|
export interface BoundingBox extends Point
|
||||||
```
|
```
|
||||||
|
|
||||||
**Extends:** [Point](./puppeteer.point.md)
|
**Extends:** [Point](./puppeteer.point.md)
|
||||||
|
|
||||||
## Properties
|
## Properties
|
||||||
|
|
||||||
| Property | Modifiers | Type | Description |
|
| Property | Modifiers | Type | Description |
|
||||||
| ------------------------------------------- | --------- | ------ | ------------------------------------ |
|
| --- | --- | --- | --- |
|
||||||
| [height](./puppeteer.boundingbox.height.md) | | number | the height of the element in pixels. |
|
| [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. |
|
| [width](./puppeteer.boundingbox.width.md) | | number | the width of the element in pixels. |
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: BoundingBox.width
|
sidebar_label: BoundingBox.width
|
||||||
---
|
---
|
||||||
|
|
||||||
# BoundingBox.width property
|
# BoundingBox.width property
|
||||||
|
|
||||||
the width of the element in pixels.
|
the width of the element in pixels.
|
||||||
@ -9,7 +8,5 @@ the width of the element in pixels.
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
interface BoundingBox {
|
interface BoundingBox {width: number;}
|
||||||
width: number;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
@ -1,13 +1,10 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: BoxModel.border
|
sidebar_label: BoxModel.border
|
||||||
---
|
---
|
||||||
|
|
||||||
# BoxModel.border property
|
# BoxModel.border property
|
||||||
|
|
||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
interface BoxModel {
|
interface BoxModel {border: Point[];}
|
||||||
border: Point[];
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
@ -1,13 +1,10 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: BoxModel.content
|
sidebar_label: BoxModel.content
|
||||||
---
|
---
|
||||||
|
|
||||||
# BoxModel.content property
|
# BoxModel.content property
|
||||||
|
|
||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
interface BoxModel {
|
interface BoxModel {content: Point[];}
|
||||||
content: Point[];
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
@ -1,13 +1,10 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: BoxModel.height
|
sidebar_label: BoxModel.height
|
||||||
---
|
---
|
||||||
|
|
||||||
# BoxModel.height property
|
# BoxModel.height property
|
||||||
|
|
||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
interface BoxModel {
|
interface BoxModel {height: number;}
|
||||||
height: number;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
@ -1,13 +1,10 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: BoxModel.margin
|
sidebar_label: BoxModel.margin
|
||||||
---
|
---
|
||||||
|
|
||||||
# BoxModel.margin property
|
# BoxModel.margin property
|
||||||
|
|
||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
interface BoxModel {
|
interface BoxModel {margin: Point[];}
|
||||||
margin: Point[];
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: BoxModel
|
sidebar_label: BoxModel
|
||||||
---
|
---
|
||||||
|
|
||||||
# BoxModel interface
|
# BoxModel interface
|
||||||
|
|
||||||
|
|
||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
@ -13,10 +13,11 @@ export interface BoxModel
|
|||||||
## Properties
|
## Properties
|
||||||
|
|
||||||
| Property | Modifiers | Type | Description |
|
| Property | Modifiers | Type | Description |
|
||||||
| ------------------------------------------ | --------- | --------------------------------- | ----------- |
|
| --- | --- | --- | --- |
|
||||||
| [border](./puppeteer.boxmodel.border.md) | | [Point](./puppeteer.point.md)\[\] | |
|
| [border](./puppeteer.boxmodel.border.md) | | [Point](./puppeteer.point.md)\[\] | |
|
||||||
| [content](./puppeteer.boxmodel.content.md) | | [Point](./puppeteer.point.md)\[\] | |
|
| [content](./puppeteer.boxmodel.content.md) | | [Point](./puppeteer.point.md)\[\] | |
|
||||||
| [height](./puppeteer.boxmodel.height.md) | | number | |
|
| [height](./puppeteer.boxmodel.height.md) | | number | |
|
||||||
| [margin](./puppeteer.boxmodel.margin.md) | | [Point](./puppeteer.point.md)\[\] | |
|
| [margin](./puppeteer.boxmodel.margin.md) | | [Point](./puppeteer.point.md)\[\] | |
|
||||||
| [padding](./puppeteer.boxmodel.padding.md) | | [Point](./puppeteer.point.md)\[\] | |
|
| [padding](./puppeteer.boxmodel.padding.md) | | [Point](./puppeteer.point.md)\[\] | |
|
||||||
| [width](./puppeteer.boxmodel.width.md) | | number | |
|
| [width](./puppeteer.boxmodel.width.md) | | number | |
|
||||||
|
|
||||||
|
@ -1,13 +1,10 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: BoxModel.padding
|
sidebar_label: BoxModel.padding
|
||||||
---
|
---
|
||||||
|
|
||||||
# BoxModel.padding property
|
# BoxModel.padding property
|
||||||
|
|
||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
interface BoxModel {
|
interface BoxModel {padding: Point[];}
|
||||||
padding: Point[];
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
@ -1,13 +1,10 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: BoxModel.width
|
sidebar_label: BoxModel.width
|
||||||
---
|
---
|
||||||
|
|
||||||
# BoxModel.width property
|
# BoxModel.width property
|
||||||
|
|
||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
interface BoxModel {
|
interface BoxModel {width: number;}
|
||||||
width: number;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: Browser.browserContexts
|
sidebar_label: Browser.browserContexts
|
||||||
---
|
---
|
||||||
|
|
||||||
# Browser.browserContexts() method
|
# 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).
|
Returns an array of all open browser contexts. In a newly created browser, this will return a single instance of [BrowserContext](./puppeteer.browsercontext.md).
|
||||||
@ -9,11 +8,9 @@ Returns an array of all open browser contexts. In a newly created browser, this
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
class Browser {
|
class Browser {browserContexts(): BrowserContext[];}
|
||||||
browserContexts(): BrowserContext[];
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
[BrowserContext](./puppeteer.browsercontext.md)\[\]
|
[BrowserContext](./puppeteer.browsercontext.md)\[\]
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: Browser.close
|
sidebar_label: Browser.close
|
||||||
---
|
---
|
||||||
|
|
||||||
# Browser.close() method
|
# 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.
|
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.
|
||||||
@ -9,11 +8,9 @@ Closes Chromium and all of its pages (if any were opened). The [Browser](./puppe
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
class Browser {
|
class Browser {close(): Promise<void>;}
|
||||||
close(): Promise<void>;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
Promise<void>
|
Promise<void>
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: Browser.createIncognitoBrowserContext
|
sidebar_label: Browser.createIncognitoBrowserContext
|
||||||
---
|
---
|
||||||
|
|
||||||
# Browser.createIncognitoBrowserContext() method
|
# Browser.createIncognitoBrowserContext() method
|
||||||
|
|
||||||
Creates a new incognito browser context. This won't share cookies/cache with other browser contexts.
|
Creates a new incognito browser context. This won't share cookies/cache with other browser contexts.
|
||||||
@ -9,17 +8,13 @@ Creates a new incognito browser context. This won't share cookies/cache with oth
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
class Browser {
|
class Browser {createIncognitoBrowserContext(options?: BrowserContextOptions): Promise<BrowserContext>;}
|
||||||
createIncognitoBrowserContext(
|
|
||||||
options?: BrowserContextOptions
|
|
||||||
): Promise<BrowserContext>;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Parameters
|
## Parameters
|
||||||
|
|
||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| --------- | ------------------------------------------------------------- | ----------------- |
|
| --- | --- | --- |
|
||||||
| options | [BrowserContextOptions](./puppeteer.browsercontextoptions.md) | <i>(Optional)</i> |
|
| options | [BrowserContextOptions](./puppeteer.browsercontextoptions.md) | <i>(Optional)</i> |
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
@ -28,6 +23,7 @@ Promise<[BrowserContext](./puppeteer.browsercontext.md)>
|
|||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
(async () => {
|
(async () => {
|
||||||
const browser = await puppeteer.launch();
|
const browser = await puppeteer.launch();
|
||||||
@ -39,3 +35,4 @@ Promise<[BrowserContext](./puppeteer.browsercontext.md)>
|
|||||||
await page.goto('https://example.com');
|
await page.goto('https://example.com');
|
||||||
})();
|
})();
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: Browser.defaultBrowserContext
|
sidebar_label: Browser.defaultBrowserContext
|
||||||
---
|
---
|
||||||
|
|
||||||
# Browser.defaultBrowserContext() method
|
# Browser.defaultBrowserContext() method
|
||||||
|
|
||||||
Returns the default browser context. The default browser context cannot be closed.
|
Returns the default browser context. The default browser context cannot be closed.
|
||||||
@ -9,11 +8,9 @@ Returns the default browser context. The default browser context cannot be close
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
class Browser {
|
class Browser {defaultBrowserContext(): BrowserContext;}
|
||||||
defaultBrowserContext(): BrowserContext;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
[BrowserContext](./puppeteer.browsercontext.md)
|
[BrowserContext](./puppeteer.browsercontext.md)
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: Browser.disconnect
|
sidebar_label: Browser.disconnect
|
||||||
---
|
---
|
||||||
|
|
||||||
# Browser.disconnect() method
|
# 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.
|
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.
|
||||||
@ -9,11 +8,9 @@ Disconnects Puppeteer from the browser, but leaves the Chromium process running.
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
class Browser {
|
class Browser {disconnect(): void;}
|
||||||
disconnect(): void;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: Browser.isConnected
|
sidebar_label: Browser.isConnected
|
||||||
---
|
---
|
||||||
|
|
||||||
# Browser.isConnected() method
|
# Browser.isConnected() method
|
||||||
|
|
||||||
Indicates that the browser is connected.
|
Indicates that the browser is connected.
|
||||||
@ -9,11 +8,9 @@ Indicates that the browser is connected.
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
class Browser {
|
class Browser {isConnected(): boolean;}
|
||||||
isConnected(): boolean;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
boolean
|
boolean
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: Browser
|
sidebar_label: Browser
|
||||||
---
|
---
|
||||||
|
|
||||||
# Browser class
|
# 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).
|
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).
|
||||||
@ -11,7 +10,6 @@ A Browser is created when Puppeteer connects to a Chromium instance, either thro
|
|||||||
```typescript
|
```typescript
|
||||||
export declare class Browser extends EventEmitter
|
export declare class Browser extends EventEmitter
|
||||||
```
|
```
|
||||||
|
|
||||||
**Extends:** [EventEmitter](./puppeteer.eventemitter.md)
|
**Extends:** [EventEmitter](./puppeteer.eventemitter.md)
|
||||||
|
|
||||||
## Remarks
|
## Remarks
|
||||||
@ -59,7 +57,7 @@ const puppeteer = require('puppeteer');
|
|||||||
## Methods
|
## Methods
|
||||||
|
|
||||||
| Method | Modifiers | Description |
|
| 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). |
|
| [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. |
|
| [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. |
|
| [createIncognitoBrowserContext(options)](./puppeteer.browser.createincognitobrowsercontext.md) | | Creates a new incognito browser context. This won't share cookies/cache with other browser contexts. |
|
||||||
@ -75,3 +73,4 @@ const puppeteer = require('puppeteer');
|
|||||||
| [version()](./puppeteer.browser.version.md) | | A string representing the browser name and version. |
|
| [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. |
|
| [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). |
|
| [wsEndpoint()](./puppeteer.browser.wsendpoint.md) | | The browser websocket endpoint which can be used as an argument to [Puppeteer.connect()](./puppeteer.puppeteer.connect.md). |
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: Browser.newPage
|
sidebar_label: Browser.newPage
|
||||||
---
|
---
|
||||||
|
|
||||||
# Browser.newPage() method
|
# Browser.newPage() method
|
||||||
|
|
||||||
Promise which resolves to a new [Page](./puppeteer.page.md) object. The Page is created in a default browser context.
|
Promise which resolves to a new [Page](./puppeteer.page.md) object. The Page is created in a default browser context.
|
||||||
@ -9,11 +8,9 @@ Promise which resolves to a new [Page](./puppeteer.page.md) object. The Page is
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
class Browser {
|
class Browser {newPage(): Promise<Page>;}
|
||||||
newPage(): Promise<Page>;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
Promise<[Page](./puppeteer.page.md)>
|
Promise<[Page](./puppeteer.page.md)>
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: Browser.pages
|
sidebar_label: Browser.pages
|
||||||
---
|
---
|
||||||
|
|
||||||
# Browser.pages() method
|
# Browser.pages() method
|
||||||
|
|
||||||
An array of all open pages inside the Browser.
|
An array of all open pages inside the Browser.
|
||||||
@ -9,11 +8,8 @@ An array of all open pages inside the Browser.
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
class Browser {
|
class Browser {pages(): Promise<Page[]>;}
|
||||||
pages(): Promise<Page[]>;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
Promise<[Page](./puppeteer.page.md)\[\]>
|
Promise<[Page](./puppeteer.page.md)\[\]>
|
||||||
@ -21,3 +17,4 @@ Promise<[Page](./puppeteer.page.md)\[\]>
|
|||||||
## Remarks
|
## 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).
|
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,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: Browser.process
|
sidebar_label: Browser.process
|
||||||
---
|
---
|
||||||
|
|
||||||
# Browser.process() method
|
# Browser.process() method
|
||||||
|
|
||||||
The spawned browser process. Returns `null` if the browser instance was created with [Puppeteer.connect()](./puppeteer.puppeteer.connect.md).
|
The spawned browser process. Returns `null` if the browser instance was created with [Puppeteer.connect()](./puppeteer.puppeteer.connect.md).
|
||||||
@ -9,11 +8,9 @@ The spawned browser process. Returns `null` if the browser instance was created
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
class Browser {
|
class Browser {process(): ChildProcess | null;}
|
||||||
process(): ChildProcess | null;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
ChildProcess \| null
|
ChildProcess \| null
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: Browser.target
|
sidebar_label: Browser.target
|
||||||
---
|
---
|
||||||
|
|
||||||
# Browser.target() method
|
# Browser.target() method
|
||||||
|
|
||||||
The target associated with the browser.
|
The target associated with the browser.
|
||||||
@ -9,11 +8,9 @@ The target associated with the browser.
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
class Browser {
|
class Browser {target(): Target;}
|
||||||
target(): Target;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
[Target](./puppeteer.target.md)
|
[Target](./puppeteer.target.md)
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: Browser.targets
|
sidebar_label: Browser.targets
|
||||||
---
|
---
|
||||||
|
|
||||||
# Browser.targets() method
|
# 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.
|
All active targets inside the Browser. In case of multiple browser contexts, returns an array with all the targets in all browser contexts.
|
||||||
@ -9,11 +8,9 @@ All active targets inside the Browser. In case of multiple browser contexts, ret
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
class Browser {
|
class Browser {targets(): Target[];}
|
||||||
targets(): Target[];
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
[Target](./puppeteer.target.md)\[\]
|
[Target](./puppeteer.target.md)\[\]
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: Browser.userAgent
|
sidebar_label: Browser.userAgent
|
||||||
---
|
---
|
||||||
|
|
||||||
# Browser.userAgent() method
|
# Browser.userAgent() method
|
||||||
|
|
||||||
The browser's original user agent. Pages can override the browser user agent with [Page.setUserAgent()](./puppeteer.page.setuseragent.md).
|
The browser's original user agent. Pages can override the browser user agent with [Page.setUserAgent()](./puppeteer.page.setuseragent.md).
|
||||||
@ -9,11 +8,9 @@ The browser's original user agent. Pages can override the browser user agent wit
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
class Browser {
|
class Browser {userAgent(): Promise<string>;}
|
||||||
userAgent(): Promise<string>;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
Promise<string>
|
Promise<string>
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: Browser.version
|
sidebar_label: Browser.version
|
||||||
---
|
---
|
||||||
|
|
||||||
# Browser.version() method
|
# Browser.version() method
|
||||||
|
|
||||||
A string representing the browser name and version.
|
A string representing the browser name and version.
|
||||||
@ -9,11 +8,8 @@ A string representing the browser name and version.
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
class Browser {
|
class Browser {version(): Promise<string>;}
|
||||||
version(): Promise<string>;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
Promise<string>
|
Promise<string>
|
||||||
@ -23,3 +19,4 @@ Promise<string>
|
|||||||
For headless Chromium, this is similar to `HeadlessChrome/61.0.3153.0`. For non-headless, this is similar to `Chrome/61.0.3153.0`.
|
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.
|
The format of browser.version() might change with future releases of Chromium.
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: Browser.waitForTarget
|
sidebar_label: Browser.waitForTarget
|
||||||
---
|
---
|
||||||
|
|
||||||
# Browser.waitForTarget() method
|
# Browser.waitForTarget() method
|
||||||
|
|
||||||
Searches for a target in all browser contexts.
|
Searches for a target in all browser contexts.
|
||||||
@ -9,18 +8,13 @@ Searches for a target in all browser contexts.
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
class Browser {
|
class Browser {waitForTarget(predicate: (x: Target) => boolean | Promise<boolean>, options?: WaitForTargetOptions): Promise<Target>;}
|
||||||
waitForTarget(
|
|
||||||
predicate: (x: Target) => boolean | Promise<boolean>,
|
|
||||||
options?: WaitForTargetOptions
|
|
||||||
): Promise<Target>;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Parameters
|
## Parameters
|
||||||
|
|
||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| --------- | ---------------------------------------------------------------------------- | -------------------------------------- |
|
| --- | --- | --- |
|
||||||
| predicate | (x: [Target](./puppeteer.target.md)) => boolean \| Promise<boolean> | A function to be run for every target. |
|
| predicate | (x: [Target](./puppeteer.target.md)) => boolean \| Promise<boolean> | A function to be run for every target. |
|
||||||
| options | [WaitForTargetOptions](./puppeteer.waitfortargetoptions.md) | <i>(Optional)</i> |
|
| options | [WaitForTargetOptions](./puppeteer.waitfortargetoptions.md) | <i>(Optional)</i> |
|
||||||
|
|
||||||
@ -36,7 +30,6 @@ An example of finding a target for a page opened via `window.open`:
|
|||||||
|
|
||||||
```ts
|
```ts
|
||||||
await page.evaluate(() => window.open('https://www.example.com/'));
|
await page.evaluate(() => window.open('https://www.example.com/'));
|
||||||
const newWindowTarget = await browser.waitForTarget(
|
const newWindowTarget = await browser.waitForTarget(target => target.url() === 'https://www.example.com/');
|
||||||
target => target.url() === 'https://www.example.com/'
|
|
||||||
);
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: Browser.wsEndpoint
|
sidebar_label: Browser.wsEndpoint
|
||||||
---
|
---
|
||||||
|
|
||||||
# Browser.wsEndpoint() method
|
# Browser.wsEndpoint() method
|
||||||
|
|
||||||
The browser websocket endpoint which can be used as an argument to [Puppeteer.connect()](./puppeteer.puppeteer.connect.md).
|
The browser websocket endpoint which can be used as an argument to [Puppeteer.connect()](./puppeteer.puppeteer.connect.md).
|
||||||
@ -9,11 +8,8 @@ The browser websocket endpoint which can be used as an argument to [Puppeteer.co
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
class Browser {
|
class Browser {wsEndpoint(): string;}
|
||||||
wsEndpoint(): string;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
string
|
string
|
||||||
@ -25,3 +21,4 @@ The Browser websocket url.
|
|||||||
The format is `ws://${host}:${port}/devtools/browser/<id>`.
|
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).
|
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,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: BrowserConnectOptions.defaultViewport
|
sidebar_label: BrowserConnectOptions.defaultViewport
|
||||||
---
|
---
|
||||||
|
|
||||||
# BrowserConnectOptions.defaultViewport property
|
# BrowserConnectOptions.defaultViewport property
|
||||||
|
|
||||||
Sets the viewport for each page.
|
Sets the viewport for each page.
|
||||||
@ -9,7 +8,5 @@ Sets the viewport for each page.
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
interface BrowserConnectOptions {
|
interface BrowserConnectOptions {defaultViewport?: Viewport | null;}
|
||||||
defaultViewport?: Viewport | null;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: BrowserConnectOptions.ignoreHTTPSErrors
|
sidebar_label: BrowserConnectOptions.ignoreHTTPSErrors
|
||||||
---
|
---
|
||||||
|
|
||||||
# BrowserConnectOptions.ignoreHTTPSErrors property
|
# BrowserConnectOptions.ignoreHTTPSErrors property
|
||||||
|
|
||||||
Whether to ignore HTTPS errors during navigation.
|
Whether to ignore HTTPS errors during navigation.
|
||||||
@ -9,7 +8,5 @@ Whether to ignore HTTPS errors during navigation.
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
interface BrowserConnectOptions {
|
interface BrowserConnectOptions {ignoreHTTPSErrors?: boolean;}
|
||||||
ignoreHTTPSErrors?: boolean;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: BrowserConnectOptions
|
sidebar_label: BrowserConnectOptions
|
||||||
---
|
---
|
||||||
|
|
||||||
# BrowserConnectOptions interface
|
# BrowserConnectOptions interface
|
||||||
|
|
||||||
Generic browser options that can be passed when launching any browser or when connecting to an existing browser instance.
|
Generic browser options that can be passed when launching any browser or when connecting to an existing browser instance.
|
||||||
@ -15,8 +14,9 @@ export interface BrowserConnectOptions
|
|||||||
## Properties
|
## Properties
|
||||||
|
|
||||||
| Property | Modifiers | Type | Description |
|
| Property | Modifiers | Type | Description |
|
||||||
| ---------------------------------------------------------------------------- | --------- | ----------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
|
| --- | --- | --- | --- |
|
||||||
| [defaultViewport?](./puppeteer.browserconnectoptions.defaultviewport.md) | | [Viewport](./puppeteer.viewport.md) \| null | <i>(Optional)</i> Sets the viewport for each page. |
|
| [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. |
|
| [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. |
|
| [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. |
|
| [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. |
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: BrowserConnectOptions.slowMo
|
sidebar_label: BrowserConnectOptions.slowMo
|
||||||
---
|
---
|
||||||
|
|
||||||
# BrowserConnectOptions.slowMo property
|
# BrowserConnectOptions.slowMo property
|
||||||
|
|
||||||
Slows down Puppeteer operations by the specified amount of milliseconds to aid debugging.
|
Slows down Puppeteer operations by the specified amount of milliseconds to aid debugging.
|
||||||
@ -9,7 +8,5 @@ Slows down Puppeteer operations by the specified amount of milliseconds to aid d
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
interface BrowserConnectOptions {
|
interface BrowserConnectOptions {slowMo?: number;}
|
||||||
slowMo?: number;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: BrowserConnectOptions.targetFilter
|
sidebar_label: BrowserConnectOptions.targetFilter
|
||||||
---
|
---
|
||||||
|
|
||||||
# BrowserConnectOptions.targetFilter property
|
# BrowserConnectOptions.targetFilter property
|
||||||
|
|
||||||
Callback to decide if Puppeteer should connect to a given target or not.
|
Callback to decide if Puppeteer should connect to a given target or not.
|
||||||
@ -9,7 +8,5 @@ Callback to decide if Puppeteer should connect to a given target or not.
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
interface BrowserConnectOptions {
|
interface BrowserConnectOptions {targetFilter?: TargetFilterCallback;}
|
||||||
targetFilter?: TargetFilterCallback;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: BrowserContext.browser
|
sidebar_label: BrowserContext.browser
|
||||||
---
|
---
|
||||||
|
|
||||||
# BrowserContext.browser() method
|
# BrowserContext.browser() method
|
||||||
|
|
||||||
The browser this browser context belongs to.
|
The browser this browser context belongs to.
|
||||||
@ -9,11 +8,9 @@ The browser this browser context belongs to.
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
class BrowserContext {
|
class BrowserContext {browser(): Browser;}
|
||||||
browser(): Browser;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
[Browser](./puppeteer.browser.md)
|
[Browser](./puppeteer.browser.md)
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: BrowserContext.clearPermissionOverrides
|
sidebar_label: BrowserContext.clearPermissionOverrides
|
||||||
---
|
---
|
||||||
|
|
||||||
# BrowserContext.clearPermissionOverrides() method
|
# BrowserContext.clearPermissionOverrides() method
|
||||||
|
|
||||||
Clears all permission overrides for the browser context.
|
Clears all permission overrides for the browser context.
|
||||||
@ -9,20 +8,19 @@ Clears all permission overrides for the browser context.
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
class BrowserContext {
|
class BrowserContext {clearPermissionOverrides(): Promise<void>;}
|
||||||
clearPermissionOverrides(): Promise<void>;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
Promise<void>
|
Promise<void>
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
const context = browser.defaultBrowserContext();
|
const context = browser.defaultBrowserContext();
|
||||||
context.overridePermissions('https://example.com', ['clipboard-read']);
|
context.overridePermissions('https://example.com', ['clipboard-read']);
|
||||||
// do stuff ..
|
// do stuff ..
|
||||||
context.clearPermissionOverrides();
|
context.clearPermissionOverrides();
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: BrowserContext.close
|
sidebar_label: BrowserContext.close
|
||||||
---
|
---
|
||||||
|
|
||||||
# BrowserContext.close() method
|
# BrowserContext.close() method
|
||||||
|
|
||||||
Closes the browser context. All the targets that belong to the browser context will be closed.
|
Closes the browser context. All the targets that belong to the browser context will be closed.
|
||||||
@ -9,11 +8,8 @@ Closes the browser context. All the targets that belong to the browser context w
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
class BrowserContext {
|
class BrowserContext {close(): Promise<void>;}
|
||||||
close(): Promise<void>;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
Promise<void>
|
Promise<void>
|
||||||
@ -21,3 +17,4 @@ Promise<void>
|
|||||||
## Remarks
|
## Remarks
|
||||||
|
|
||||||
Only incognito browser contexts can be closed.
|
Only incognito browser contexts can be closed.
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: BrowserContext.isIncognito
|
sidebar_label: BrowserContext.isIncognito
|
||||||
---
|
---
|
||||||
|
|
||||||
# BrowserContext.isIncognito() method
|
# BrowserContext.isIncognito() method
|
||||||
|
|
||||||
Returns whether BrowserContext is incognito. The default browser context is the only non-incognito browser context.
|
Returns whether BrowserContext is incognito. The default browser context is the only non-incognito browser context.
|
||||||
@ -9,11 +8,8 @@ Returns whether BrowserContext is incognito. The default browser context is the
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
class BrowserContext {
|
class BrowserContext {isIncognito(): boolean;}
|
||||||
isIncognito(): boolean;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
boolean
|
boolean
|
||||||
@ -21,3 +17,4 @@ boolean
|
|||||||
## Remarks
|
## Remarks
|
||||||
|
|
||||||
The default browser context cannot be closed.
|
The default browser context cannot be closed.
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: BrowserContext
|
sidebar_label: BrowserContext
|
||||||
---
|
---
|
||||||
|
|
||||||
# BrowserContext class
|
# 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.
|
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.
|
||||||
@ -11,7 +10,6 @@ BrowserContexts provide a way to operate multiple independent browser sessions.
|
|||||||
```typescript
|
```typescript
|
||||||
export declare class BrowserContext extends EventEmitter
|
export declare class BrowserContext extends EventEmitter
|
||||||
```
|
```
|
||||||
|
|
||||||
**Extends:** [EventEmitter](./puppeteer.eventemitter.md)
|
**Extends:** [EventEmitter](./puppeteer.eventemitter.md)
|
||||||
|
|
||||||
## Remarks
|
## Remarks
|
||||||
@ -26,6 +24,7 @@ The constructor for this class is marked as internal. Third-party code should no
|
|||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
// Create a new incognito browser context
|
// Create a new incognito browser context
|
||||||
const context = await browser.createIncognitoBrowserContext();
|
const context = await browser.createIncognitoBrowserContext();
|
||||||
@ -40,7 +39,7 @@ await context.close();
|
|||||||
## Methods
|
## Methods
|
||||||
|
|
||||||
| Method | Modifiers | Description |
|
| Method | Modifiers | Description |
|
||||||
| --------------------------------------------------------------------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------- |
|
| --- | --- | --- |
|
||||||
| [browser()](./puppeteer.browsercontext.browser.md) | | The browser this browser context belongs to. |
|
| [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. |
|
| [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. |
|
| [close()](./puppeteer.browsercontext.close.md) | | Closes the browser context. All the targets that belong to the browser context will be closed. |
|
||||||
@ -50,3 +49,4 @@ await context.close();
|
|||||||
| [pages()](./puppeteer.browsercontext.pages.md) | | An array of all pages inside the browser context. |
|
| [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. |
|
| [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. |
|
| [waitForTarget(predicate, options)](./puppeteer.browsercontext.waitfortarget.md) | | This searches for a target in this specific browser context. |
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: BrowserContext.newPage
|
sidebar_label: BrowserContext.newPage
|
||||||
---
|
---
|
||||||
|
|
||||||
# BrowserContext.newPage() method
|
# BrowserContext.newPage() method
|
||||||
|
|
||||||
Creates a new page in the browser context.
|
Creates a new page in the browser context.
|
||||||
@ -9,11 +8,9 @@ Creates a new page in the browser context.
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
class BrowserContext {
|
class BrowserContext {newPage(): Promise<Page>;}
|
||||||
newPage(): Promise<Page>;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
Promise<[Page](./puppeteer.page.md)>
|
Promise<[Page](./puppeteer.page.md)>
|
||||||
|
|
||||||
|
@ -1,21 +1,18 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: BrowserContext.overridePermissions
|
sidebar_label: BrowserContext.overridePermissions
|
||||||
---
|
---
|
||||||
|
|
||||||
# BrowserContext.overridePermissions() method
|
# BrowserContext.overridePermissions() method
|
||||||
|
|
||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
class BrowserContext {
|
class BrowserContext {overridePermissions(origin: string, permissions: Permission[]): Promise<void>;}
|
||||||
overridePermissions(origin: string, permissions: Permission[]): Promise<void>;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Parameters
|
## Parameters
|
||||||
|
|
||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| ----------- | ------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
|
| --- | --- | --- |
|
||||||
| origin | string | The origin to grant permissions to, e.g. "https://example.com". |
|
| 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. |
|
| permissions | [Permission](./puppeteer.permission.md)\[\] | An array of permissions to grant. All permissions that are not listed here will be automatically denied. |
|
||||||
|
|
||||||
@ -25,7 +22,9 @@ Promise<void>
|
|||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
const context = browser.defaultBrowserContext();
|
const context = browser.defaultBrowserContext();
|
||||||
await context.overridePermissions('https://html5demos.com', ['geolocation']);
|
await context.overridePermissions('https://html5demos.com', ['geolocation']);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: BrowserContext.pages
|
sidebar_label: BrowserContext.pages
|
||||||
---
|
---
|
||||||
|
|
||||||
# BrowserContext.pages() method
|
# BrowserContext.pages() method
|
||||||
|
|
||||||
An array of all pages inside the browser context.
|
An array of all pages inside the browser context.
|
||||||
@ -9,13 +8,11 @@ An array of all pages inside the browser context.
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
class BrowserContext {
|
class BrowserContext {pages(): Promise<Page[]>;}
|
||||||
pages(): Promise<Page[]>;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
Promise<[Page](./puppeteer.page.md)\[\]>
|
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).
|
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,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: BrowserContext.targets
|
sidebar_label: BrowserContext.targets
|
||||||
---
|
---
|
||||||
|
|
||||||
# BrowserContext.targets() method
|
# BrowserContext.targets() method
|
||||||
|
|
||||||
An array of all active targets inside the browser context.
|
An array of all active targets inside the browser context.
|
||||||
@ -9,11 +8,9 @@ An array of all active targets inside the browser context.
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
class BrowserContext {
|
class BrowserContext {targets(): Target[];}
|
||||||
targets(): Target[];
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
[Target](./puppeteer.target.md)\[\]
|
[Target](./puppeteer.target.md)\[\]
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: BrowserContext.waitForTarget
|
sidebar_label: BrowserContext.waitForTarget
|
||||||
---
|
---
|
||||||
|
|
||||||
# BrowserContext.waitForTarget() method
|
# BrowserContext.waitForTarget() method
|
||||||
|
|
||||||
This searches for a target in this specific browser context.
|
This searches for a target in this specific browser context.
|
||||||
@ -9,20 +8,15 @@ This searches for a target in this specific browser context.
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
class BrowserContext {
|
class BrowserContext {waitForTarget(predicate: (x: Target) => boolean | Promise<boolean>, options?: {
|
||||||
waitForTarget(
|
|
||||||
predicate: (x: Target) => boolean | Promise<boolean>,
|
|
||||||
options?: {
|
|
||||||
timeout?: number;
|
timeout?: number;
|
||||||
}
|
}): Promise<Target>;}
|
||||||
): Promise<Target>;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Parameters
|
## Parameters
|
||||||
|
|
||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| --------- | ---------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| --- | --- | --- |
|
||||||
| predicate | (x: [Target](./puppeteer.target.md)) => boolean \| Promise<boolean> | A function to be run for every target |
|
| predicate | (x: [Target](./puppeteer.target.md)) => boolean \| Promise<boolean> | 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. |
|
| 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. |
|
||||||
|
|
||||||
@ -38,7 +32,6 @@ An example of finding a target for a page opened via `window.open`:
|
|||||||
|
|
||||||
```ts
|
```ts
|
||||||
await page.evaluate(() => window.open('https://www.example.com/'));
|
await page.evaluate(() => window.open('https://www.example.com/'));
|
||||||
const newWindowTarget = await browserContext.waitForTarget(
|
const newWindowTarget = await browserContext.waitForTarget(target => target.url() === 'https://www.example.com/');
|
||||||
target => target.url() === 'https://www.example.com/'
|
|
||||||
);
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: BrowserContextEmittedEvents
|
sidebar_label: BrowserContextEmittedEvents
|
||||||
---
|
---
|
||||||
|
|
||||||
# BrowserContextEmittedEvents enum
|
# BrowserContextEmittedEvents enum
|
||||||
|
|
||||||
|
|
||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
@ -13,7 +13,8 @@ export declare const enum BrowserContextEmittedEvents
|
|||||||
## Enumeration Members
|
## Enumeration Members
|
||||||
|
|
||||||
| Member | Value | Description |
|
| 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. |
|
| 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> | <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> |
|
| TargetCreated | <code>"targetcreated"</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>"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. |
|
| 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,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: BrowserContextOptions
|
sidebar_label: BrowserContextOptions
|
||||||
---
|
---
|
||||||
|
|
||||||
# BrowserContextOptions interface
|
# BrowserContextOptions interface
|
||||||
|
|
||||||
BrowserContext options.
|
BrowserContext options.
|
||||||
@ -15,6 +14,7 @@ export interface BrowserContextOptions
|
|||||||
## Properties
|
## Properties
|
||||||
|
|
||||||
| Property | Modifiers | Type | Description |
|
| 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. |
|
| [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>. |
|
| [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>. |
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: BrowserContextOptions.proxyBypassList
|
sidebar_label: BrowserContextOptions.proxyBypassList
|
||||||
---
|
---
|
||||||
|
|
||||||
# BrowserContextOptions.proxyBypassList property
|
# BrowserContextOptions.proxyBypassList property
|
||||||
|
|
||||||
Bypass the proxy for the given semi-colon-separated list of hosts.
|
Bypass the proxy for the given semi-colon-separated list of hosts.
|
||||||
@ -9,7 +8,5 @@ Bypass the proxy for the given semi-colon-separated list of hosts.
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
interface BrowserContextOptions {
|
interface BrowserContextOptions {proxyBypassList?: string[];}
|
||||||
proxyBypassList?: string[];
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: BrowserContextOptions.proxyServer
|
sidebar_label: BrowserContextOptions.proxyServer
|
||||||
---
|
---
|
||||||
|
|
||||||
# BrowserContextOptions.proxyServer property
|
# BrowserContextOptions.proxyServer property
|
||||||
|
|
||||||
Proxy server with optional port to use for all requests. Username and password can be set in `Page.authenticate`.
|
Proxy server with optional port to use for all requests. Username and password can be set in `Page.authenticate`.
|
||||||
@ -9,7 +8,5 @@ Proxy server with optional port to use for all requests. Username and password c
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
interface BrowserContextOptions {
|
interface BrowserContextOptions {proxyServer?: string;}
|
||||||
proxyServer?: string;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: BrowserEmittedEvents
|
sidebar_label: BrowserEmittedEvents
|
||||||
---
|
---
|
||||||
|
|
||||||
# BrowserEmittedEvents enum
|
# BrowserEmittedEvents enum
|
||||||
|
|
||||||
All the events a [browser instance](./puppeteer.browser.md) may emit.
|
All the events a [browser instance](./puppeteer.browser.md) may emit.
|
||||||
@ -15,8 +14,9 @@ export declare const enum BrowserEmittedEvents
|
|||||||
## Enumeration Members
|
## Enumeration Members
|
||||||
|
|
||||||
| Member | Value | Description |
|
| Member | Value | Description |
|
||||||
| --------------- | ---------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| --- | --- | --- |
|
||||||
| Disconnected | <code>"disconnected"</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> |
|
| Disconnected | <code>"disconnected"</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>"targetchanged"</code> | Emitted when the url of a target changes. Contains a [Target](./puppeteer.target.md) instance. |
|
| TargetChanged | <code>"targetchanged"</code> | Emitted when the url of a target changes. Contains a [Target](./puppeteer.target.md) instance. |
|
||||||
| TargetCreated | <code>"targetcreated"</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> |
|
| TargetCreated | <code>"targetcreated"</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>"targetdestroyed"</code> | Emitted when a target is destroyed, for example when a page is closed. 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,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: BrowserFetcher.canDownload
|
sidebar_label: BrowserFetcher.canDownload
|
||||||
---
|
---
|
||||||
|
|
||||||
# BrowserFetcher.canDownload() method
|
# BrowserFetcher.canDownload() method
|
||||||
|
|
||||||
Initiates a HEAD request to check if the revision is available.
|
Initiates a HEAD request to check if the revision is available.
|
||||||
@ -9,15 +8,13 @@ Initiates a HEAD request to check if the revision is available.
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
class BrowserFetcher {
|
class BrowserFetcher {canDownload(revision: string): Promise<boolean>;}
|
||||||
canDownload(revision: string): Promise<boolean>;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Parameters
|
## Parameters
|
||||||
|
|
||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| --------- | ------ | --------------------------------------- |
|
| --- | --- | --- |
|
||||||
| revision | string | The revision to check availability for. |
|
| revision | string | The revision to check availability for. |
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
@ -29,3 +26,4 @@ A promise that resolves to `true` if the revision could be downloaded from the h
|
|||||||
## Remarks
|
## Remarks
|
||||||
|
|
||||||
This method is affected by the current `product`.
|
This method is affected by the current `product`.
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: BrowserFetcher.download
|
sidebar_label: BrowserFetcher.download
|
||||||
---
|
---
|
||||||
|
|
||||||
# BrowserFetcher.download() method
|
# BrowserFetcher.download() method
|
||||||
|
|
||||||
Initiates a GET request to download the revision from the host.
|
Initiates a GET request to download the revision from the host.
|
||||||
@ -9,18 +8,13 @@ Initiates a GET request to download the revision from the host.
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
class BrowserFetcher {
|
class BrowserFetcher {download(revision: string, progressCallback?: (x: number, y: number) => void): Promise<BrowserFetcherRevisionInfo | undefined>;}
|
||||||
download(
|
|
||||||
revision: string,
|
|
||||||
progressCallback?: (x: number, y: number) => void
|
|
||||||
): Promise<BrowserFetcherRevisionInfo | undefined>;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Parameters
|
## Parameters
|
||||||
|
|
||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| ---------------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| --- | --- | --- |
|
||||||
| revision | string | The revision to download. |
|
| revision | string | The revision to download. |
|
||||||
| progressCallback | (x: number, y: number) => 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. |
|
| progressCallback | (x: number, y: number) => 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. |
|
||||||
|
|
||||||
@ -33,3 +27,4 @@ A promise with revision information when the revision is downloaded and extracte
|
|||||||
## Remarks
|
## Remarks
|
||||||
|
|
||||||
This method is affected by the current `product`.
|
This method is affected by the current `product`.
|
||||||
|
|
||||||
|
@ -1,19 +1,16 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: BrowserFetcher.host
|
sidebar_label: BrowserFetcher.host
|
||||||
---
|
---
|
||||||
|
|
||||||
# BrowserFetcher.host() method
|
# BrowserFetcher.host() method
|
||||||
|
|
||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
class BrowserFetcher {
|
class BrowserFetcher {host(): string;}
|
||||||
host(): string;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
string
|
string
|
||||||
|
|
||||||
The download host being used.
|
The download host being used.
|
||||||
|
|
||||||
|
@ -1,17 +1,13 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: BrowserFetcher.localRevisions
|
sidebar_label: BrowserFetcher.localRevisions
|
||||||
---
|
---
|
||||||
|
|
||||||
# BrowserFetcher.localRevisions() method
|
# BrowserFetcher.localRevisions() method
|
||||||
|
|
||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
class BrowserFetcher {
|
class BrowserFetcher {localRevisions(): Promise<string[]>;}
|
||||||
localRevisions(): Promise<string[]>;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
Promise<string\[\]>
|
Promise<string\[\]>
|
||||||
@ -21,3 +17,4 @@ A promise with a list of all revision strings (for the current `product`) availa
|
|||||||
## Remarks
|
## Remarks
|
||||||
|
|
||||||
This method is affected by the current `product`.
|
This method is affected by the current `product`.
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: BrowserFetcher
|
sidebar_label: BrowserFetcher
|
||||||
---
|
---
|
||||||
|
|
||||||
# BrowserFetcher class
|
# BrowserFetcher class
|
||||||
|
|
||||||
BrowserFetcher can download and manage different versions of Chromium and Firefox.
|
BrowserFetcher can download and manage different versions of Chromium and Firefox.
|
||||||
@ -25,17 +24,14 @@ An example of using BrowserFetcher to download a specific version of Chromium an
|
|||||||
```ts
|
```ts
|
||||||
const browserFetcher = puppeteer.createBrowserFetcher();
|
const browserFetcher = puppeteer.createBrowserFetcher();
|
||||||
const revisionInfo = await browserFetcher.download('533271');
|
const revisionInfo = await browserFetcher.download('533271');
|
||||||
const browser = await puppeteer.launch({
|
const browser = await puppeteer.launch({executablePath: revisionInfo.executablePath})
|
||||||
executablePath: revisionInfo.executablePath,
|
|
||||||
});
|
|
||||||
```
|
```
|
||||||
|
|
||||||
\*\*NOTE\*\* BrowserFetcher is not designed to work concurrently with other instances of BrowserFetcher that share the same downloads directory.
|
\*\*NOTE\*\* BrowserFetcher is not designed to work concurrently with other instances of BrowserFetcher that share the same downloads directory.
|
||||||
|
|
||||||
## Methods
|
## Methods
|
||||||
|
|
||||||
| Method | Modifiers | Description |
|
| Method | Modifiers | Description |
|
||||||
| ------------------------------------------------------------------------------ | --------- | --------------------------------------------------------------- |
|
| --- | --- | --- |
|
||||||
| [canDownload(revision)](./puppeteer.browserfetcher.candownload.md) | | Initiates a HEAD request to check if the revision is available. |
|
| [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. |
|
| [download(revision, progressCallback)](./puppeteer.browserfetcher.download.md) | | Initiates a GET request to download the revision from the host. |
|
||||||
| [host()](./puppeteer.browserfetcher.host.md) | | |
|
| [host()](./puppeteer.browserfetcher.host.md) | | |
|
||||||
@ -44,3 +40,4 @@ const browser = await puppeteer.launch({
|
|||||||
| [product()](./puppeteer.browserfetcher.product.md) | | |
|
| [product()](./puppeteer.browserfetcher.product.md) | | |
|
||||||
| [remove(revision)](./puppeteer.browserfetcher.remove.md) | | |
|
| [remove(revision)](./puppeteer.browserfetcher.remove.md) | | |
|
||||||
| [revisionInfo(revision)](./puppeteer.browserfetcher.revisioninfo.md) | | |
|
| [revisionInfo(revision)](./puppeteer.browserfetcher.revisioninfo.md) | | |
|
||||||
|
|
||||||
|
@ -1,19 +1,16 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: BrowserFetcher.platform
|
sidebar_label: BrowserFetcher.platform
|
||||||
---
|
---
|
||||||
|
|
||||||
# BrowserFetcher.platform() method
|
# BrowserFetcher.platform() method
|
||||||
|
|
||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
class BrowserFetcher {
|
class BrowserFetcher {platform(): Platform;}
|
||||||
platform(): Platform;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
[Platform](./puppeteer.platform.md)
|
[Platform](./puppeteer.platform.md)
|
||||||
|
|
||||||
Returns the current `Platform`, which is one of `mac`, `linux`, `win32` or `win64`.
|
Returns the current `Platform`, which is one of `mac`, `linux`, `win32` or `win64`.
|
||||||
|
|
||||||
|
@ -1,19 +1,16 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: BrowserFetcher.product
|
sidebar_label: BrowserFetcher.product
|
||||||
---
|
---
|
||||||
|
|
||||||
# BrowserFetcher.product() method
|
# BrowserFetcher.product() method
|
||||||
|
|
||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
class BrowserFetcher {
|
class BrowserFetcher {product(): Product;}
|
||||||
product(): Product;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
[Product](./puppeteer.product.md)
|
[Product](./puppeteer.product.md)
|
||||||
|
|
||||||
Returns the current `Product`, which is one of `chrome` or `firefox`.
|
Returns the current `Product`, which is one of `chrome` or `firefox`.
|
||||||
|
|
||||||
|
@ -1,21 +1,18 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: BrowserFetcher.remove
|
sidebar_label: BrowserFetcher.remove
|
||||||
---
|
---
|
||||||
|
|
||||||
# BrowserFetcher.remove() method
|
# BrowserFetcher.remove() method
|
||||||
|
|
||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
class BrowserFetcher {
|
class BrowserFetcher {remove(revision: string): Promise<void>;}
|
||||||
remove(revision: string): Promise<void>;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Parameters
|
## Parameters
|
||||||
|
|
||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| --------- | ------ | ---------------------------------------------------------- |
|
| --- | --- | --- |
|
||||||
| revision | string | A revision to remove for the current <code>product</code>. |
|
| revision | string | A revision to remove for the current <code>product</code>. |
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
@ -27,3 +24,4 @@ A promise that resolves when the revision has been removes or throws if the revi
|
|||||||
## Remarks
|
## Remarks
|
||||||
|
|
||||||
This method is affected by the current `product`.
|
This method is affected by the current `product`.
|
||||||
|
|
||||||
|
@ -1,21 +1,18 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: BrowserFetcher.revisionInfo
|
sidebar_label: BrowserFetcher.revisionInfo
|
||||||
---
|
---
|
||||||
|
|
||||||
# BrowserFetcher.revisionInfo() method
|
# BrowserFetcher.revisionInfo() method
|
||||||
|
|
||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
class BrowserFetcher {
|
class BrowserFetcher {revisionInfo(revision: string): BrowserFetcherRevisionInfo;}
|
||||||
revisionInfo(revision: string): BrowserFetcherRevisionInfo;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Parameters
|
## Parameters
|
||||||
|
|
||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| --------- | ------ | ----------------------------- |
|
| --- | --- | --- |
|
||||||
| revision | string | The revision to get info for. |
|
| revision | string | The revision to get info for. |
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
@ -23,3 +20,4 @@ class BrowserFetcher {
|
|||||||
[BrowserFetcherRevisionInfo](./puppeteer.browserfetcherrevisioninfo.md)
|
[BrowserFetcherRevisionInfo](./puppeteer.browserfetcherrevisioninfo.md)
|
||||||
|
|
||||||
The revision info for the given revision.
|
The revision info for the given revision.
|
||||||
|
|
||||||
|
@ -1,13 +1,10 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: BrowserFetcherOptions.host
|
sidebar_label: BrowserFetcherOptions.host
|
||||||
---
|
---
|
||||||
|
|
||||||
# BrowserFetcherOptions.host property
|
# BrowserFetcherOptions.host property
|
||||||
|
|
||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
interface BrowserFetcherOptions {
|
interface BrowserFetcherOptions {host?: string;}
|
||||||
host?: string;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: BrowserFetcherOptions
|
sidebar_label: BrowserFetcherOptions
|
||||||
---
|
---
|
||||||
|
|
||||||
# BrowserFetcherOptions interface
|
# BrowserFetcherOptions interface
|
||||||
|
|
||||||
|
|
||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
@ -13,8 +13,9 @@ export interface BrowserFetcherOptions
|
|||||||
## Properties
|
## Properties
|
||||||
|
|
||||||
| Property | Modifiers | Type | Description |
|
| Property | Modifiers | Type | Description |
|
||||||
| ---------------------------------------------------------- | --------- | ----------------------------------- | ----------------- |
|
| --- | --- | --- | --- |
|
||||||
| [host?](./puppeteer.browserfetcheroptions.host.md) | | string | <i>(Optional)</i> |
|
| [host?](./puppeteer.browserfetcheroptions.host.md) | | string | <i>(Optional)</i> |
|
||||||
| [path?](./puppeteer.browserfetcheroptions.path.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> |
|
| [platform?](./puppeteer.browserfetcheroptions.platform.md) | | [Platform](./puppeteer.platform.md) | <i>(Optional)</i> |
|
||||||
| [product?](./puppeteer.browserfetcheroptions.product.md) | | string | <i>(Optional)</i> |
|
| [product?](./puppeteer.browserfetcheroptions.product.md) | | string | <i>(Optional)</i> |
|
||||||
|
|
||||||
|
@ -1,13 +1,10 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: BrowserFetcherOptions.path
|
sidebar_label: BrowserFetcherOptions.path
|
||||||
---
|
---
|
||||||
|
|
||||||
# BrowserFetcherOptions.path property
|
# BrowserFetcherOptions.path property
|
||||||
|
|
||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
interface BrowserFetcherOptions {
|
interface BrowserFetcherOptions {path?: string;}
|
||||||
path?: string;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
@ -1,13 +1,10 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: BrowserFetcherOptions.platform
|
sidebar_label: BrowserFetcherOptions.platform
|
||||||
---
|
---
|
||||||
|
|
||||||
# BrowserFetcherOptions.platform property
|
# BrowserFetcherOptions.platform property
|
||||||
|
|
||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
interface BrowserFetcherOptions {
|
interface BrowserFetcherOptions {platform?: Platform;}
|
||||||
platform?: Platform;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
@ -1,13 +1,10 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: BrowserFetcherOptions.product
|
sidebar_label: BrowserFetcherOptions.product
|
||||||
---
|
---
|
||||||
|
|
||||||
# BrowserFetcherOptions.product property
|
# BrowserFetcherOptions.product property
|
||||||
|
|
||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
interface BrowserFetcherOptions {
|
interface BrowserFetcherOptions {product?: string;}
|
||||||
product?: string;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
@ -1,13 +1,10 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: BrowserFetcherRevisionInfo.executablePath
|
sidebar_label: BrowserFetcherRevisionInfo.executablePath
|
||||||
---
|
---
|
||||||
|
|
||||||
# BrowserFetcherRevisionInfo.executablePath property
|
# BrowserFetcherRevisionInfo.executablePath property
|
||||||
|
|
||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
interface BrowserFetcherRevisionInfo {
|
interface BrowserFetcherRevisionInfo {executablePath: string;}
|
||||||
executablePath: string;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
@ -1,13 +1,10 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: BrowserFetcherRevisionInfo.folderPath
|
sidebar_label: BrowserFetcherRevisionInfo.folderPath
|
||||||
---
|
---
|
||||||
|
|
||||||
# BrowserFetcherRevisionInfo.folderPath property
|
# BrowserFetcherRevisionInfo.folderPath property
|
||||||
|
|
||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
interface BrowserFetcherRevisionInfo {
|
interface BrowserFetcherRevisionInfo {folderPath: string;}
|
||||||
folderPath: string;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
@ -1,13 +1,10 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: BrowserFetcherRevisionInfo.local
|
sidebar_label: BrowserFetcherRevisionInfo.local
|
||||||
---
|
---
|
||||||
|
|
||||||
# BrowserFetcherRevisionInfo.local property
|
# BrowserFetcherRevisionInfo.local property
|
||||||
|
|
||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
interface BrowserFetcherRevisionInfo {
|
interface BrowserFetcherRevisionInfo {local: boolean;}
|
||||||
local: boolean;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: BrowserFetcherRevisionInfo
|
sidebar_label: BrowserFetcherRevisionInfo
|
||||||
---
|
---
|
||||||
|
|
||||||
# BrowserFetcherRevisionInfo interface
|
# BrowserFetcherRevisionInfo interface
|
||||||
|
|
||||||
|
|
||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
@ -13,10 +13,11 @@ export interface BrowserFetcherRevisionInfo
|
|||||||
## Properties
|
## Properties
|
||||||
|
|
||||||
| Property | Modifiers | Type | Description |
|
| Property | Modifiers | Type | Description |
|
||||||
| -------------------------------------------------------------------------- | --------- | ------- | ----------- |
|
| --- | --- | --- | --- |
|
||||||
| [executablePath](./puppeteer.browserfetcherrevisioninfo.executablepath.md) | | string | |
|
| [executablePath](./puppeteer.browserfetcherrevisioninfo.executablepath.md) | | string | |
|
||||||
| [folderPath](./puppeteer.browserfetcherrevisioninfo.folderpath.md) | | string | |
|
| [folderPath](./puppeteer.browserfetcherrevisioninfo.folderpath.md) | | string | |
|
||||||
| [local](./puppeteer.browserfetcherrevisioninfo.local.md) | | boolean | |
|
| [local](./puppeteer.browserfetcherrevisioninfo.local.md) | | boolean | |
|
||||||
| [product](./puppeteer.browserfetcherrevisioninfo.product.md) | | string | |
|
| [product](./puppeteer.browserfetcherrevisioninfo.product.md) | | string | |
|
||||||
| [revision](./puppeteer.browserfetcherrevisioninfo.revision.md) | | string | |
|
| [revision](./puppeteer.browserfetcherrevisioninfo.revision.md) | | string | |
|
||||||
| [url](./puppeteer.browserfetcherrevisioninfo.url.md) | | string | |
|
| [url](./puppeteer.browserfetcherrevisioninfo.url.md) | | string | |
|
||||||
|
|
||||||
|
@ -1,13 +1,10 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: BrowserFetcherRevisionInfo.product
|
sidebar_label: BrowserFetcherRevisionInfo.product
|
||||||
---
|
---
|
||||||
|
|
||||||
# BrowserFetcherRevisionInfo.product property
|
# BrowserFetcherRevisionInfo.product property
|
||||||
|
|
||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
interface BrowserFetcherRevisionInfo {
|
interface BrowserFetcherRevisionInfo {product: string;}
|
||||||
product: string;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
@ -1,13 +1,10 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: BrowserFetcherRevisionInfo.revision
|
sidebar_label: BrowserFetcherRevisionInfo.revision
|
||||||
---
|
---
|
||||||
|
|
||||||
# BrowserFetcherRevisionInfo.revision property
|
# BrowserFetcherRevisionInfo.revision property
|
||||||
|
|
||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
interface BrowserFetcherRevisionInfo {
|
interface BrowserFetcherRevisionInfo {revision: string;}
|
||||||
revision: string;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
@ -1,13 +1,10 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: BrowserFetcherRevisionInfo.url
|
sidebar_label: BrowserFetcherRevisionInfo.url
|
||||||
---
|
---
|
||||||
|
|
||||||
# BrowserFetcherRevisionInfo.url property
|
# BrowserFetcherRevisionInfo.url property
|
||||||
|
|
||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
interface BrowserFetcherRevisionInfo {
|
interface BrowserFetcherRevisionInfo {url: string;}
|
||||||
url: string;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: BrowserLaunchArgumentOptions.args
|
sidebar_label: BrowserLaunchArgumentOptions.args
|
||||||
---
|
---
|
||||||
|
|
||||||
# BrowserLaunchArgumentOptions.args property
|
# BrowserLaunchArgumentOptions.args property
|
||||||
|
|
||||||
Additional command line arguments to pass to the browser instance.
|
Additional command line arguments to pass to the browser instance.
|
||||||
@ -9,7 +8,5 @@ Additional command line arguments to pass to the browser instance.
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
interface BrowserLaunchArgumentOptions {
|
interface BrowserLaunchArgumentOptions {args?: string[];}
|
||||||
args?: string[];
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
@ -1,13 +1,10 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: BrowserLaunchArgumentOptions.debuggingPort
|
sidebar_label: BrowserLaunchArgumentOptions.debuggingPort
|
||||||
---
|
---
|
||||||
|
|
||||||
# BrowserLaunchArgumentOptions.debuggingPort property
|
# BrowserLaunchArgumentOptions.debuggingPort property
|
||||||
|
|
||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
interface BrowserLaunchArgumentOptions {
|
interface BrowserLaunchArgumentOptions {debuggingPort?: number;}
|
||||||
debuggingPort?: number;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: BrowserLaunchArgumentOptions.devtools
|
sidebar_label: BrowserLaunchArgumentOptions.devtools
|
||||||
---
|
---
|
||||||
|
|
||||||
# BrowserLaunchArgumentOptions.devtools property
|
# 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`.
|
Whether to auto-open a DevTools panel for each tab. If this is set to `true`, then `headless` will be forced to `false`.
|
||||||
@ -9,7 +8,5 @@ Whether to auto-open a DevTools panel for each tab. If this is set to `true`, th
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
interface BrowserLaunchArgumentOptions {
|
interface BrowserLaunchArgumentOptions {devtools?: boolean;}
|
||||||
devtools?: boolean;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: BrowserLaunchArgumentOptions.headless
|
sidebar_label: BrowserLaunchArgumentOptions.headless
|
||||||
---
|
---
|
||||||
|
|
||||||
# BrowserLaunchArgumentOptions.headless property
|
# BrowserLaunchArgumentOptions.headless property
|
||||||
|
|
||||||
Whether to run the browser in headless mode.
|
Whether to run the browser in headless mode.
|
||||||
@ -9,7 +8,5 @@ Whether to run the browser in headless mode.
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
interface BrowserLaunchArgumentOptions {
|
interface BrowserLaunchArgumentOptions {headless?: boolean | 'chrome';}
|
||||||
headless?: boolean | 'chrome';
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: BrowserLaunchArgumentOptions
|
sidebar_label: BrowserLaunchArgumentOptions
|
||||||
---
|
---
|
||||||
|
|
||||||
# BrowserLaunchArgumentOptions interface
|
# BrowserLaunchArgumentOptions interface
|
||||||
|
|
||||||
Launcher options that only apply to Chrome.
|
Launcher options that only apply to Chrome.
|
||||||
@ -15,9 +14,10 @@ export interface BrowserLaunchArgumentOptions
|
|||||||
## Properties
|
## Properties
|
||||||
|
|
||||||
| Property | Modifiers | Type | Description |
|
| Property | Modifiers | Type | Description |
|
||||||
| --------------------------------------------------------------------------- | --------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| --- | --- | --- | --- |
|
||||||
| [args?](./puppeteer.browserlaunchargumentoptions.args.md) | | string\[\] | <i>(Optional)</i> Additional command line arguments to pass to the browser instance. |
|
| [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> |
|
| [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>. |
|
| [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. |
|
| [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. |
|
| [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. |
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: BrowserLaunchArgumentOptions.userDataDir
|
sidebar_label: BrowserLaunchArgumentOptions.userDataDir
|
||||||
---
|
---
|
||||||
|
|
||||||
# BrowserLaunchArgumentOptions.userDataDir property
|
# 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.
|
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.
|
||||||
@ -9,7 +8,5 @@ Path to a user data directory. [see the Chromium docs](https://chromium.googleso
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
interface BrowserLaunchArgumentOptions {
|
interface BrowserLaunchArgumentOptions {userDataDir?: string;}
|
||||||
userDataDir?: string;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
@ -1,17 +1,14 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: CDPSession.connection
|
sidebar_label: CDPSession.connection
|
||||||
---
|
---
|
||||||
|
|
||||||
# CDPSession.connection() method
|
# CDPSession.connection() method
|
||||||
|
|
||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
class CDPSession {
|
class CDPSession {connection(): Connection | undefined;}
|
||||||
connection(): Connection | undefined;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
[Connection](./puppeteer.connection.md) \| undefined
|
[Connection](./puppeteer.connection.md) \| undefined
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: CDPSession.detach
|
sidebar_label: CDPSession.detach
|
||||||
---
|
---
|
||||||
|
|
||||||
# CDPSession.detach() method
|
# 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.
|
Detaches the cdpSession from the target. Once detached, the cdpSession object won't emit any events and can't be used to send messages.
|
||||||
@ -9,11 +8,9 @@ Detaches the cdpSession from the target. Once detached, the cdpSession object wo
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
class CDPSession {
|
class CDPSession {detach(): Promise<void>;}
|
||||||
detach(): Promise<void>;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
Promise<void>
|
Promise<void>
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: CDPSession.id
|
sidebar_label: CDPSession.id
|
||||||
---
|
---
|
||||||
|
|
||||||
# CDPSession.id() method
|
# CDPSession.id() method
|
||||||
|
|
||||||
Returns the session's id.
|
Returns the session's id.
|
||||||
@ -9,11 +8,9 @@ Returns the session's id.
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
class CDPSession {
|
class CDPSession {id(): string;}
|
||||||
id(): string;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
string
|
string
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: CDPSession
|
sidebar_label: CDPSession
|
||||||
---
|
---
|
||||||
|
|
||||||
# CDPSession class
|
# CDPSession class
|
||||||
|
|
||||||
The `CDPSession` instances are used to talk raw Chrome Devtools Protocol.
|
The `CDPSession` instances are used to talk raw Chrome Devtools Protocol.
|
||||||
@ -11,7 +10,6 @@ The `CDPSession` instances are used to talk raw Chrome Devtools Protocol.
|
|||||||
```typescript
|
```typescript
|
||||||
export declare class CDPSession extends EventEmitter
|
export declare class CDPSession extends EventEmitter
|
||||||
```
|
```
|
||||||
|
|
||||||
**Extends:** [EventEmitter](./puppeteer.eventemitter.md)
|
**Extends:** [EventEmitter](./puppeteer.eventemitter.md)
|
||||||
|
|
||||||
## Remarks
|
## Remarks
|
||||||
@ -24,24 +22,24 @@ The constructor for this class is marked as internal. Third-party code should no
|
|||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
const client = await page.target().createCDPSession();
|
const client = await page.target().createCDPSession();
|
||||||
await client.send('Animation.enable');
|
await client.send('Animation.enable');
|
||||||
client.on('Animation.animationCreated', () =>
|
client.on('Animation.animationCreated', () => console.log('Animation created!'));
|
||||||
console.log('Animation created!')
|
|
||||||
);
|
|
||||||
const response = await client.send('Animation.getPlaybackRate');
|
const response = await client.send('Animation.getPlaybackRate');
|
||||||
console.log('playback rate is ' + response.playbackRate);
|
console.log('playback rate is ' + response.playbackRate);
|
||||||
await client.send('Animation.setPlaybackRate', {
|
await client.send('Animation.setPlaybackRate', {
|
||||||
playbackRate: response.playbackRate / 2,
|
playbackRate: response.playbackRate / 2
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
## Methods
|
## Methods
|
||||||
|
|
||||||
| Method | Modifiers | Description |
|
| Method | Modifiers | Description |
|
||||||
| --------------------------------------------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------- |
|
| --- | --- | --- |
|
||||||
| [connection()](./puppeteer.cdpsession.connection.md) | | |
|
| [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. |
|
| [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. |
|
| [id()](./puppeteer.cdpsession.id.md) | | Returns the session's id. |
|
||||||
| [send(method, paramArgs)](./puppeteer.cdpsession.send.md) | | |
|
| [send(method, paramArgs)](./puppeteer.cdpsession.send.md) | | |
|
||||||
|
|
||||||
|
@ -1,27 +1,22 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: CDPSession.send
|
sidebar_label: CDPSession.send
|
||||||
---
|
---
|
||||||
|
|
||||||
# CDPSession.send() method
|
# CDPSession.send() method
|
||||||
|
|
||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
class CDPSession {
|
class CDPSession {send<T extends keyof ProtocolMapping.Commands>(method: T, ...paramArgs: ProtocolMapping.Commands[T]['paramsType']): Promise<ProtocolMapping.Commands[T]['returnType']>;}
|
||||||
send<T extends keyof ProtocolMapping.Commands>(
|
|
||||||
method: T,
|
|
||||||
...paramArgs: ProtocolMapping.Commands[T]['paramsType']
|
|
||||||
): Promise<ProtocolMapping.Commands[T]['returnType']>;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Parameters
|
## Parameters
|
||||||
|
|
||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| --------- | --------------------------------------------- | ----------- |
|
| --- | --- | --- |
|
||||||
| method | T | |
|
| method | T | |
|
||||||
| paramArgs | ProtocolMapping.Commands\[T\]\['paramsType'\] | |
|
| paramArgs | ProtocolMapping.Commands\[T\]\['paramsType'\] | |
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
Promise<ProtocolMapping.Commands\[T\]\['returnType'\]>
|
Promise<ProtocolMapping.Commands\[T\]\['returnType'\]>
|
||||||
|
|
||||||
|
@ -1,17 +1,14 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: CDPSessionOnMessageObject.error
|
sidebar_label: CDPSessionOnMessageObject.error
|
||||||
---
|
---
|
||||||
|
|
||||||
# CDPSessionOnMessageObject.error property
|
# CDPSessionOnMessageObject.error property
|
||||||
|
|
||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
interface CDPSessionOnMessageObject {
|
interface CDPSessionOnMessageObject {error: {
|
||||||
error: {
|
|
||||||
message: string;
|
message: string;
|
||||||
data: any;
|
data: any;
|
||||||
code: number;
|
code: number;
|
||||||
};
|
};}
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
@ -1,13 +1,10 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: CDPSessionOnMessageObject.id
|
sidebar_label: CDPSessionOnMessageObject.id
|
||||||
---
|
---
|
||||||
|
|
||||||
# CDPSessionOnMessageObject.id property
|
# CDPSessionOnMessageObject.id property
|
||||||
|
|
||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
interface CDPSessionOnMessageObject {
|
interface CDPSessionOnMessageObject {id?: number;}
|
||||||
id?: number;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: CDPSessionOnMessageObject
|
sidebar_label: CDPSessionOnMessageObject
|
||||||
---
|
---
|
||||||
|
|
||||||
# CDPSessionOnMessageObject interface
|
# CDPSessionOnMessageObject interface
|
||||||
|
|
||||||
|
|
||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
@ -13,9 +13,10 @@ export interface CDPSessionOnMessageObject
|
|||||||
## Properties
|
## Properties
|
||||||
|
|
||||||
| Property | Modifiers | Type | Description |
|
| Property | Modifiers | Type | Description |
|
||||||
| ---------------------------------------------------------- | --------- | --------------------------------------------- | ----------------- |
|
| --- | --- | --- | --- |
|
||||||
| [error](./puppeteer.cdpsessiononmessageobject.error.md) | | { message: string; data: any; code: number; } | |
|
| [error](./puppeteer.cdpsessiononmessageobject.error.md) | | { message: string; data: any; code: number; } | |
|
||||||
| [id?](./puppeteer.cdpsessiononmessageobject.id.md) | | number | <i>(Optional)</i> |
|
| [id?](./puppeteer.cdpsessiononmessageobject.id.md) | | number | <i>(Optional)</i> |
|
||||||
| [method](./puppeteer.cdpsessiononmessageobject.method.md) | | string | |
|
| [method](./puppeteer.cdpsessiononmessageobject.method.md) | | string | |
|
||||||
| [params](./puppeteer.cdpsessiononmessageobject.params.md) | | Record<string, unknown> | |
|
| [params](./puppeteer.cdpsessiononmessageobject.params.md) | | Record<string, unknown> | |
|
||||||
| [result?](./puppeteer.cdpsessiononmessageobject.result.md) | | any | <i>(Optional)</i> |
|
| [result?](./puppeteer.cdpsessiononmessageobject.result.md) | | any | <i>(Optional)</i> |
|
||||||
|
|
||||||
|
@ -1,13 +1,10 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: CDPSessionOnMessageObject.method
|
sidebar_label: CDPSessionOnMessageObject.method
|
||||||
---
|
---
|
||||||
|
|
||||||
# CDPSessionOnMessageObject.method property
|
# CDPSessionOnMessageObject.method property
|
||||||
|
|
||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
interface CDPSessionOnMessageObject {
|
interface CDPSessionOnMessageObject {method: string;}
|
||||||
method: string;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
@ -1,13 +1,10 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: CDPSessionOnMessageObject.params
|
sidebar_label: CDPSessionOnMessageObject.params
|
||||||
---
|
---
|
||||||
|
|
||||||
# CDPSessionOnMessageObject.params property
|
# CDPSessionOnMessageObject.params property
|
||||||
|
|
||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
interface CDPSessionOnMessageObject {
|
interface CDPSessionOnMessageObject {params: Record<string, unknown>;}
|
||||||
params: Record<string, unknown>;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
@ -1,13 +1,10 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: CDPSessionOnMessageObject.result
|
sidebar_label: CDPSessionOnMessageObject.result
|
||||||
---
|
---
|
||||||
|
|
||||||
# CDPSessionOnMessageObject.result property
|
# CDPSessionOnMessageObject.result property
|
||||||
|
|
||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
interface CDPSessionOnMessageObject {
|
interface CDPSessionOnMessageObject {result?: any;}
|
||||||
result?: any;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
@ -1,15 +1,11 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: ChromeReleaseChannel
|
sidebar_label: ChromeReleaseChannel
|
||||||
---
|
---
|
||||||
|
|
||||||
# ChromeReleaseChannel type
|
# ChromeReleaseChannel type
|
||||||
|
|
||||||
|
|
||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
export declare type ChromeReleaseChannel =
|
export declare type ChromeReleaseChannel = 'chrome' | 'chrome-beta' | 'chrome-canary' | 'chrome-dev';
|
||||||
| 'chrome'
|
|
||||||
| 'chrome-beta'
|
|
||||||
| 'chrome-canary'
|
|
||||||
| 'chrome-dev';
|
|
||||||
```
|
```
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: clearCustomQueryHandlers
|
sidebar_label: clearCustomQueryHandlers
|
||||||
---
|
---
|
||||||
|
|
||||||
# clearCustomQueryHandlers() function
|
# clearCustomQueryHandlers() function
|
||||||
|
|
||||||
Clears all registered handlers.
|
Clears all registered handlers.
|
||||||
@ -11,7 +10,7 @@ Clears all registered handlers.
|
|||||||
```typescript
|
```typescript
|
||||||
export declare function clearCustomQueryHandlers(): void;
|
export declare function clearCustomQueryHandlers(): void;
|
||||||
```
|
```
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
||||||
|
@ -1,13 +1,10 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: ClickOptions.button
|
sidebar_label: ClickOptions.button
|
||||||
---
|
---
|
||||||
|
|
||||||
# ClickOptions.button property
|
# ClickOptions.button property
|
||||||
|
|
||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
interface ClickOptions {
|
interface ClickOptions {button?: MouseButton;}
|
||||||
button?: MouseButton;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
@ -1,13 +1,10 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: ClickOptions.clickCount
|
sidebar_label: ClickOptions.clickCount
|
||||||
---
|
---
|
||||||
|
|
||||||
# ClickOptions.clickCount property
|
# ClickOptions.clickCount property
|
||||||
|
|
||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
interface ClickOptions {
|
interface ClickOptions {clickCount?: number;}
|
||||||
clickCount?: number;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: ClickOptions.delay
|
sidebar_label: ClickOptions.delay
|
||||||
---
|
---
|
||||||
|
|
||||||
# ClickOptions.delay property
|
# ClickOptions.delay property
|
||||||
|
|
||||||
Time to wait between `mousedown` and `mouseup` in milliseconds.
|
Time to wait between `mousedown` and `mouseup` in milliseconds.
|
||||||
@ -9,7 +8,5 @@ Time to wait between `mousedown` and `mouseup` in milliseconds.
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
interface ClickOptions {
|
interface ClickOptions {delay?: number;}
|
||||||
delay?: number;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: ClickOptions
|
sidebar_label: ClickOptions
|
||||||
---
|
---
|
||||||
|
|
||||||
# ClickOptions interface
|
# ClickOptions interface
|
||||||
|
|
||||||
|
|
||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
@ -13,8 +13,9 @@ export interface ClickOptions
|
|||||||
## Properties
|
## Properties
|
||||||
|
|
||||||
| Property | Modifiers | Type | Description |
|
| Property | Modifiers | Type | Description |
|
||||||
| ----------------------------------------------------- | --------- | ----------------------------------------- | ------------------------------------------------------------------------------------------------------- |
|
| --- | --- | --- | --- |
|
||||||
| [button?](./puppeteer.clickoptions.button.md) | | [MouseButton](./puppeteer.mousebutton.md) | <i>(Optional)</i> |
|
| [button?](./puppeteer.clickoptions.button.md) | | [MouseButton](./puppeteer.mousebutton.md) | <i>(Optional)</i> |
|
||||||
| [clickCount?](./puppeteer.clickoptions.clickcount.md) | | number | <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. |
|
| [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. |
|
| [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. |
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: ClickOptions.offset
|
sidebar_label: ClickOptions.offset
|
||||||
---
|
---
|
||||||
|
|
||||||
# ClickOptions.offset property
|
# ClickOptions.offset property
|
||||||
|
|
||||||
Offset for the clickable point relative to the top-left corder of the border box.
|
Offset for the clickable point relative to the top-left corder of the border box.
|
||||||
@ -9,7 +8,5 @@ Offset for the clickable point relative to the top-left corder of the border box
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
interface ClickOptions {
|
interface ClickOptions {offset?: Offset;}
|
||||||
offset?: Offset;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
@ -1,24 +1,22 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: CommonEventEmitter.addListener
|
sidebar_label: CommonEventEmitter.addListener
|
||||||
---
|
---
|
||||||
|
|
||||||
# CommonEventEmitter.addListener() method
|
# CommonEventEmitter.addListener() method
|
||||||
|
|
||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
interface CommonEventEmitter {
|
interface CommonEventEmitter {addListener(event: EventType, handler: Handler): CommonEventEmitter;}
|
||||||
addListener(event: EventType, handler: Handler): CommonEventEmitter;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Parameters
|
## Parameters
|
||||||
|
|
||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| --------- | ------------------------------------- | ----------- |
|
| --- | --- | --- |
|
||||||
| event | [EventType](./puppeteer.eventtype.md) | |
|
| event | [EventType](./puppeteer.eventtype.md) | |
|
||||||
| handler | [Handler](./puppeteer.handler.md) | |
|
| handler | [Handler](./puppeteer.handler.md) | |
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
[CommonEventEmitter](./puppeteer.commoneventemitter.md)
|
[CommonEventEmitter](./puppeteer.commoneventemitter.md)
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user