mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
chore(deps-dev): Bump the dev-dependencies group with 3 updates (#12101)
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Nikolay Vitkov <nvitkov@chromium.org>
This commit is contained in:
parent
8e6fb3dc39
commit
93e9acc410
1620
docs/api/index.md
1620
docs/api/index.md
File diff suppressed because it is too large
Load Diff
@ -24,6 +24,28 @@ The constructor for this class is marked as internal. Third-party code should no
|
||||
|
||||
## Methods
|
||||
|
||||
| Method | Modifiers | Description |
|
||||
| ---------------------------------------------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [snapshot(options)](./puppeteer.accessibility.snapshot.md) | | Captures the current state of the accessibility tree. The returned object represents the root accessible node of the page. |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Method
|
||||
|
||||
</th><th>
|
||||
|
||||
Modifiers
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
[snapshot(options)](./puppeteer.accessibility.snapshot.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
Captures the current state of the accessibility tree. The returned object represents the root accessible node of the page.
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
|
@ -16,10 +16,33 @@ class Accessibility {
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ------------------------------------------------- | ------------ |
|
||||
| options | [SnapshotOptions](./puppeteer.snapshotoptions.md) | _(Optional)_ |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Parameter
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
options
|
||||
|
||||
</td><td>
|
||||
|
||||
[SnapshotOptions](./puppeteer.snapshotoptions.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
_(Optional)_
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
**Returns:**
|
||||
|
||||
Promise<[SerializedAXNode](./puppeteer.serializedaxnode.md) \| null>
|
||||
|
@ -12,6 +12,42 @@ export interface ActionOptions
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Modifiers | Type | Description | Default |
|
||||
| -------- | --------------------- | ----------- | ----------- | ------- |
|
||||
| signal | <code>optional</code> | AbortSignal | | |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Property
|
||||
|
||||
</th><th>
|
||||
|
||||
Modifiers
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th><th>
|
||||
|
||||
Default
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
signal
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
AbortSignal
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
|
@ -12,6 +12,40 @@ export interface AutofillData
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Modifiers | Type | Description | Default |
|
||||
| ---------- | --------- | ------------------------------------------------------------------------------------------------- | ----------- | ------- |
|
||||
| creditCard | | { number: string; name: string; expiryMonth: string; expiryYear: string; cvc: string; } | | |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Property
|
||||
|
||||
</th><th>
|
||||
|
||||
Modifiers
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th><th>
|
||||
|
||||
Default
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
creditCard
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
{ number: string; name: string; expiryMonth: string; expiryYear: string; cvc: string; }
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
|
@ -14,7 +14,59 @@ export interface BoundingBox extends Point
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Modifiers | Type | Description | Default |
|
||||
| -------- | --------- | ------ | ------------------------------------ | ------- |
|
||||
| height | | number | the height of the element in pixels. | |
|
||||
| width | | number | the width of the element in pixels. | |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Property
|
||||
|
||||
</th><th>
|
||||
|
||||
Modifiers
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th><th>
|
||||
|
||||
Default
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
height
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
number
|
||||
|
||||
</td><td>
|
||||
|
||||
the height of the element in pixels.
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
width
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
number
|
||||
|
||||
</td><td>
|
||||
|
||||
the width of the element in pixels.
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
|
@ -12,11 +12,115 @@ export interface BoxModel
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Modifiers | Type | Description | Default |
|
||||
| -------- | --------- | --------------------------- | ----------- | ------- |
|
||||
| border | | [Quad](./puppeteer.quad.md) | | |
|
||||
| content | | [Quad](./puppeteer.quad.md) | | |
|
||||
| height | | number | | |
|
||||
| margin | | [Quad](./puppeteer.quad.md) | | |
|
||||
| padding | | [Quad](./puppeteer.quad.md) | | |
|
||||
| width | | number | | |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Property
|
||||
|
||||
</th><th>
|
||||
|
||||
Modifiers
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th><th>
|
||||
|
||||
Default
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
border
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
[Quad](./puppeteer.quad.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
content
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
[Quad](./puppeteer.quad.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
height
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
number
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
margin
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
[Quad](./puppeteer.quad.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
padding
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
[Quad](./puppeteer.quad.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
width
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
number
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
|
@ -20,10 +20,33 @@ class Browser {
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ------------------------------------------------------------- | ------------ |
|
||||
| options | [BrowserContextOptions](./puppeteer.browsercontextoptions.md) | _(Optional)_ |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Parameter
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
options
|
||||
|
||||
</td><td>
|
||||
|
||||
[BrowserContextOptions](./puppeteer.browsercontextoptions.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
_(Optional)_
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
**Returns:**
|
||||
|
||||
Promise<[BrowserContext](./puppeteer.browsercontext.md)>
|
||||
|
@ -56,27 +56,259 @@ await browser2.close();
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Modifiers | Type | Description |
|
||||
| --------- | --------------------- | ------------------------------------- | ------------------------------------------------------------------------- |
|
||||
| connected | <code>readonly</code> | boolean | Whether Puppeteer is connected to this [browser](./puppeteer.browser.md). |
|
||||
| debugInfo | <code>readonly</code> | [DebugInfo](./puppeteer.debuginfo.md) | Get debug information from Puppeteer. |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Property
|
||||
|
||||
</th><th>
|
||||
|
||||
Modifiers
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
connected
|
||||
|
||||
</td><td>
|
||||
|
||||
`readonly`
|
||||
|
||||
</td><td>
|
||||
|
||||
boolean
|
||||
|
||||
</td><td>
|
||||
|
||||
Whether Puppeteer is connected to this [browser](./puppeteer.browser.md).
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
debugInfo
|
||||
|
||||
</td><td>
|
||||
|
||||
`readonly`
|
||||
|
||||
</td><td>
|
||||
|
||||
[DebugInfo](./puppeteer.debuginfo.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
Get debug information from Puppeteer.
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
|
||||
## Methods
|
||||
|
||||
| Method | Modifiers | Description |
|
||||
| ---------------------------------------------------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [browserContexts()](./puppeteer.browser.browsercontexts.md) | | <p>Gets a list of open [browser contexts](./puppeteer.browsercontext.md).</p><p>In a newly-created [browser](./puppeteer.browser.md), this will return a single instance of [BrowserContext](./puppeteer.browsercontext.md).</p> |
|
||||
| [close()](./puppeteer.browser.close.md) | | Closes this [browser](./puppeteer.browser.md) and all associated [pages](./puppeteer.page.md). |
|
||||
| [createBrowserContext(options)](./puppeteer.browser.createbrowsercontext.md) | | <p>Creates a new [browser context](./puppeteer.browsercontext.md).</p><p>This won't share cookies/cache with other [browser contexts](./puppeteer.browsercontext.md).</p> |
|
||||
| [defaultBrowserContext()](./puppeteer.browser.defaultbrowsercontext.md) | | Gets the default [browser context](./puppeteer.browsercontext.md). |
|
||||
| [disconnect()](./puppeteer.browser.disconnect.md) | | Disconnects Puppeteer from this [browser](./puppeteer.browser.md), but leaves the process running. |
|
||||
| [isConnected()](./puppeteer.browser.isconnected.md) | | Whether Puppeteer is connected to this [browser](./puppeteer.browser.md). |
|
||||
| [newPage()](./puppeteer.browser.newpage.md) | | Creates a new [page](./puppeteer.page.md) in the [default browser context](./puppeteer.browser.defaultbrowsercontext.md). |
|
||||
| [pages()](./puppeteer.browser.pages.md) | | <p>Gets a list of all open [pages](./puppeteer.page.md) inside this [Browser](./puppeteer.browser.md).</p><p>If there ar multiple [browser contexts](./puppeteer.browsercontext.md), this returns all [pages](./puppeteer.page.md) in all [browser contexts](./puppeteer.browsercontext.md).</p> |
|
||||
| [process()](./puppeteer.browser.process.md) | | Gets the associated [ChildProcess](https://nodejs.org/api/child_process.html#class-childprocess). |
|
||||
| [target()](./puppeteer.browser.target.md) | | Gets the [target](./puppeteer.target.md) associated with the [default browser context](./puppeteer.browser.defaultbrowsercontext.md)). |
|
||||
| [targets()](./puppeteer.browser.targets.md) | | <p>Gets all active [targets](./puppeteer.target.md).</p><p>In case of multiple [browser contexts](./puppeteer.browsercontext.md), this returns all [targets](./puppeteer.target.md) in all [browser contexts](./puppeteer.browsercontext.md).</p> |
|
||||
| [userAgent()](./puppeteer.browser.useragent.md) | | <p>Gets this [browser's](./puppeteer.browser.md) original user agent.</p><p>[Pages](./puppeteer.page.md) can override the user agent with [Page.setUserAgent()](./puppeteer.page.setuseragent.md).</p> |
|
||||
| [version()](./puppeteer.browser.version.md) | | <p>Gets a string representing this [browser's](./puppeteer.browser.md) name and version.</p><p>For headless browser, this is similar to <code>"HeadlessChrome/61.0.3153.0"</code>. For non-headless or new-headless, this is similar to <code>"Chrome/61.0.3153.0"</code>. For Firefox, it is similar to <code>"Firefox/116.0a1"</code>.</p><p>The format of [Browser.version()](./puppeteer.browser.version.md) might change with future releases of browsers.</p> |
|
||||
| [waitForTarget(predicate, options)](./puppeteer.browser.waitfortarget.md) | | <p>Waits until a [target](./puppeteer.target.md) matching the given <code>predicate</code> appears and returns it.</p><p>This will look all open [browser contexts](./puppeteer.browsercontext.md).</p> |
|
||||
| [wsEndpoint()](./puppeteer.browser.wsendpoint.md) | | <p>Gets the WebSocket URL to connect to this [browser](./puppeteer.browser.md).</p><p>This is usually used with [Puppeteer.connect()](./puppeteer.puppeteer.connect.md).</p><p>You can find the debugger URL (<code>webSocketDebuggerUrl</code>) from <code>http://HOST:PORT/json/version</code>.</p><p>See [browser endpoint](https://chromedevtools.github.io/devtools-protocol/#how-do-i-access-the-browser-target) for more information.</p> |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Method
|
||||
|
||||
</th><th>
|
||||
|
||||
Modifiers
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
[browserContexts()](./puppeteer.browser.browsercontexts.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
Gets a list of open [browser contexts](./puppeteer.browsercontext.md).
|
||||
|
||||
In a newly-created [browser](./puppeteer.browser.md), this will return a single instance of [BrowserContext](./puppeteer.browsercontext.md).
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[close()](./puppeteer.browser.close.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
Closes this [browser](./puppeteer.browser.md) and all associated [pages](./puppeteer.page.md).
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[createBrowserContext(options)](./puppeteer.browser.createbrowsercontext.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
Creates a new [browser context](./puppeteer.browsercontext.md).
|
||||
|
||||
This won't share cookies/cache with other [browser contexts](./puppeteer.browsercontext.md).
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[defaultBrowserContext()](./puppeteer.browser.defaultbrowsercontext.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
Gets the default [browser context](./puppeteer.browsercontext.md).
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[disconnect()](./puppeteer.browser.disconnect.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
Disconnects Puppeteer from this [browser](./puppeteer.browser.md), but leaves the process running.
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[isConnected()](./puppeteer.browser.isconnected.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
Whether Puppeteer is connected to this [browser](./puppeteer.browser.md).
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[newPage()](./puppeteer.browser.newpage.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
Creates a new [page](./puppeteer.page.md) in the [default browser context](./puppeteer.browser.defaultbrowsercontext.md).
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[pages()](./puppeteer.browser.pages.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
Gets a list of all open [pages](./puppeteer.page.md) inside this [Browser](./puppeteer.browser.md).
|
||||
|
||||
If there ar multiple [browser contexts](./puppeteer.browsercontext.md), this returns all [pages](./puppeteer.page.md) in all [browser contexts](./puppeteer.browsercontext.md).
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[process()](./puppeteer.browser.process.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
Gets the associated [ChildProcess](https://nodejs.org/api/child_process.html#class-childprocess).
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[target()](./puppeteer.browser.target.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
Gets the [target](./puppeteer.target.md) associated with the [default browser context](./puppeteer.browser.defaultbrowsercontext.md)).
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[targets()](./puppeteer.browser.targets.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
Gets all active [targets](./puppeteer.target.md).
|
||||
|
||||
In case of multiple [browser contexts](./puppeteer.browsercontext.md), this returns all [targets](./puppeteer.target.md) in all [browser contexts](./puppeteer.browsercontext.md).
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[userAgent()](./puppeteer.browser.useragent.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
Gets this [browser's](./puppeteer.browser.md) original user agent.
|
||||
|
||||
[Pages](./puppeteer.page.md) can override the user agent with [Page.setUserAgent()](./puppeteer.page.setuseragent.md).
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[version()](./puppeteer.browser.version.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
Gets a string representing this [browser's](./puppeteer.browser.md) name and version.
|
||||
|
||||
For headless browser, this is similar to `"HeadlessChrome/61.0.3153.0"`. For non-headless or new-headless, this is similar to `"Chrome/61.0.3153.0"`. For Firefox, it is similar to `"Firefox/116.0a1"`.
|
||||
|
||||
The format of [Browser.version()](./puppeteer.browser.version.md) might change with future releases of browsers.
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[waitForTarget(predicate, options)](./puppeteer.browser.waitfortarget.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
Waits until a [target](./puppeteer.target.md) matching the given `predicate` appears and returns it.
|
||||
|
||||
This will look all open [browser contexts](./puppeteer.browsercontext.md).
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[wsEndpoint()](./puppeteer.browser.wsendpoint.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
Gets the WebSocket URL to connect to this [browser](./puppeteer.browser.md).
|
||||
|
||||
This is usually used with [Puppeteer.connect()](./puppeteer.puppeteer.connect.md).
|
||||
|
||||
You can find the debugger URL (`webSocketDebuggerUrl`) from `http://HOST:PORT/json/version`.
|
||||
|
||||
See [browser endpoint](https://chromedevtools.github.io/devtools-protocol/#how-do-i-access-the-browser-target) for more information.
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
|
@ -21,11 +21,44 @@ class Browser {
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ---------------------------------------------------------------------------- | ------------ |
|
||||
| predicate | (x: [Target](./puppeteer.target.md)) => boolean \| Promise<boolean> | |
|
||||
| options | [WaitForTargetOptions](./puppeteer.waitfortargetoptions.md) | _(Optional)_ |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Parameter
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
predicate
|
||||
|
||||
</td><td>
|
||||
|
||||
(x: [Target](./puppeteer.target.md)) => boolean \| Promise<boolean>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
options
|
||||
|
||||
</td><td>
|
||||
|
||||
[WaitForTargetOptions](./puppeteer.waitfortargetoptions.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
_(Optional)_
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
**Returns:**
|
||||
|
||||
Promise<[Target](./puppeteer.target.md)>
|
||||
|
@ -14,11 +14,145 @@ export interface BrowserConnectOptions
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Modifiers | Type | Description | Default |
|
||||
| ----------------- | --------------------- | ----------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ------------------------------------- |
|
||||
| defaultViewport | <code>optional</code> | [Viewport](./puppeteer.viewport.md) \| null | Sets the viewport for each page. | '{width: 800, height: 600}' |
|
||||
| ignoreHTTPSErrors | <code>optional</code> | boolean | Whether to ignore HTTPS errors during navigation. | <code>false</code> |
|
||||
| protocol | <code>optional</code> | [ProtocolType](./puppeteer.protocoltype.md) | | 'cdp' |
|
||||
| protocolTimeout | <code>optional</code> | number | Timeout setting for individual protocol (CDP) calls. | <code>180_000</code> |
|
||||
| slowMo | <code>optional</code> | number | Slows down Puppeteer operations by the specified amount of milliseconds to aid debugging. | |
|
||||
| targetFilter | <code>optional</code> | [TargetFilterCallback](./puppeteer.targetfiltercallback.md) | Callback to decide if Puppeteer should connect to a given target or not. | |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Property
|
||||
|
||||
</th><th>
|
||||
|
||||
Modifiers
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th><th>
|
||||
|
||||
Default
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
defaultViewport
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
[Viewport](./puppeteer.viewport.md) \| null
|
||||
|
||||
</td><td>
|
||||
|
||||
Sets the viewport for each page.
|
||||
|
||||
</td><td>
|
||||
|
||||
'{width: 800, height: 600}'
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
ignoreHTTPSErrors
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
boolean
|
||||
|
||||
</td><td>
|
||||
|
||||
Whether to ignore HTTPS errors during navigation.
|
||||
|
||||
</td><td>
|
||||
|
||||
`false`
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
protocol
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
[ProtocolType](./puppeteer.protocoltype.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
'cdp'
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
protocolTimeout
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
number
|
||||
|
||||
</td><td>
|
||||
|
||||
Timeout setting for individual protocol (CDP) calls.
|
||||
|
||||
</td><td>
|
||||
|
||||
`180_000`
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
slowMo
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
number
|
||||
|
||||
</td><td>
|
||||
|
||||
Slows down Puppeteer operations by the specified amount of milliseconds to aid debugging.
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
targetFilter
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
[TargetFilterCallback](./puppeteer.targetfiltercallback.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
Callback to decide if Puppeteer should connect to a given target or not.
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
|
@ -41,21 +41,175 @@ await context.close();
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Modifiers | Type | Description |
|
||||
| -------- | --------------------- | ------------------- | ------------------------------------------------------------------------ |
|
||||
| closed | <code>readonly</code> | boolean | Whether this [browser context](./puppeteer.browsercontext.md) is closed. |
|
||||
| id | <code>readonly</code> | string \| undefined | Identifier for this [browser context](./puppeteer.browsercontext.md). |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Property
|
||||
|
||||
</th><th>
|
||||
|
||||
Modifiers
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
closed
|
||||
|
||||
</td><td>
|
||||
|
||||
`readonly`
|
||||
|
||||
</td><td>
|
||||
|
||||
boolean
|
||||
|
||||
</td><td>
|
||||
|
||||
Whether this [browser context](./puppeteer.browsercontext.md) is closed.
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
id
|
||||
|
||||
</td><td>
|
||||
|
||||
`readonly`
|
||||
|
||||
</td><td>
|
||||
|
||||
string \| undefined
|
||||
|
||||
</td><td>
|
||||
|
||||
Identifier for this [browser context](./puppeteer.browsercontext.md).
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
|
||||
## Methods
|
||||
|
||||
| Method | Modifiers | Description |
|
||||
| --------------------------------------------------------------------------------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [browser()](./puppeteer.browsercontext.browser.md) | | Gets the [browser](./puppeteer.browser.md) associated with this [browser context](./puppeteer.browsercontext.md). |
|
||||
| [clearPermissionOverrides()](./puppeteer.browsercontext.clearpermissionoverrides.md) | | Clears all permission overrides for this [browser context](./puppeteer.browsercontext.md). |
|
||||
| [close()](./puppeteer.browsercontext.close.md) | | Closes this [browser context](./puppeteer.browsercontext.md) and all associated [pages](./puppeteer.page.md). |
|
||||
| [isIncognito()](./puppeteer.browsercontext.isincognito.md) | | <p>Whether this [browser context](./puppeteer.browsercontext.md) is incognito.</p><p>In Chrome, the [default browser context](./puppeteer.browser.defaultbrowsercontext.md) is the only non-incognito browser context.</p> |
|
||||
| [newPage()](./puppeteer.browsercontext.newpage.md) | | Creates a new [page](./puppeteer.page.md) in this [browser context](./puppeteer.browsercontext.md). |
|
||||
| [overridePermissions(origin, permissions)](./puppeteer.browsercontext.overridepermissions.md) | | Grants this [browser context](./puppeteer.browsercontext.md) the given <code>permissions</code> within the given <code>origin</code>. |
|
||||
| [pages()](./puppeteer.browsercontext.pages.md) | | Gets a list of all open [pages](./puppeteer.page.md) inside this [browser context](./puppeteer.browsercontext.md). |
|
||||
| [targets()](./puppeteer.browsercontext.targets.md) | | Gets all active [targets](./puppeteer.target.md) inside this [browser context](./puppeteer.browsercontext.md). |
|
||||
| [waitForTarget(predicate, options)](./puppeteer.browsercontext.waitfortarget.md) | | <p>Waits until a [target](./puppeteer.target.md) matching the given <code>predicate</code> appears and returns it.</p><p>This will look all open [browser contexts](./puppeteer.browsercontext.md).</p> |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Method
|
||||
|
||||
</th><th>
|
||||
|
||||
Modifiers
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
[browser()](./puppeteer.browsercontext.browser.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
Gets the [browser](./puppeteer.browser.md) associated with this [browser context](./puppeteer.browsercontext.md).
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[clearPermissionOverrides()](./puppeteer.browsercontext.clearpermissionoverrides.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
Clears all permission overrides for this [browser context](./puppeteer.browsercontext.md).
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[close()](./puppeteer.browsercontext.close.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
Closes this [browser context](./puppeteer.browsercontext.md) and all associated [pages](./puppeteer.page.md).
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[isIncognito()](./puppeteer.browsercontext.isincognito.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
Whether this [browser context](./puppeteer.browsercontext.md) is incognito.
|
||||
|
||||
In Chrome, the [default browser context](./puppeteer.browser.defaultbrowsercontext.md) is the only non-incognito browser context.
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[newPage()](./puppeteer.browsercontext.newpage.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
Creates a new [page](./puppeteer.page.md) in this [browser context](./puppeteer.browsercontext.md).
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[overridePermissions(origin, permissions)](./puppeteer.browsercontext.overridepermissions.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
Grants this [browser context](./puppeteer.browsercontext.md) the given `permissions` within the given `origin`.
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[pages()](./puppeteer.browsercontext.pages.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
Gets a list of all open [pages](./puppeteer.page.md) inside this [browser context](./puppeteer.browsercontext.md).
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[targets()](./puppeteer.browsercontext.targets.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
Gets all active [targets](./puppeteer.target.md) inside this [browser context](./puppeteer.browsercontext.md).
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[waitForTarget(predicate, options)](./puppeteer.browsercontext.waitfortarget.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
Waits until a [target](./puppeteer.target.md) matching the given `predicate` appears and returns it.
|
||||
|
||||
This will look all open [browser contexts](./puppeteer.browsercontext.md).
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
|
@ -19,11 +19,46 @@ class BrowserContext {
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| ----------- | ------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
|
||||
| origin | string | The origin to grant permissions to, e.g. "https://example.com". |
|
||||
| permissions | [Permission](./puppeteer.permission.md)\[\] | An array of permissions to grant. All permissions that are not listed here will be automatically denied. |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Parameter
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
origin
|
||||
|
||||
</td><td>
|
||||
|
||||
string
|
||||
|
||||
</td><td>
|
||||
|
||||
The origin to grant permissions to, e.g. "https://example.com".
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
permissions
|
||||
|
||||
</td><td>
|
||||
|
||||
[Permission](./puppeteer.permission.md)\[\]
|
||||
|
||||
</td><td>
|
||||
|
||||
An array of permissions to grant. All permissions that are not listed here will be automatically denied.
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
**Returns:**
|
||||
|
||||
Promise<void>
|
||||
|
@ -21,11 +21,44 @@ class BrowserContext {
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ---------------------------------------------------------------------------- | ------------ |
|
||||
| predicate | (x: [Target](./puppeteer.target.md)) => boolean \| Promise<boolean> | |
|
||||
| options | [WaitForTargetOptions](./puppeteer.waitfortargetoptions.md) | _(Optional)_ |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Parameter
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
predicate
|
||||
|
||||
</td><td>
|
||||
|
||||
(x: [Target](./puppeteer.target.md)) => boolean \| Promise<boolean>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
options
|
||||
|
||||
</td><td>
|
||||
|
||||
[WaitForTargetOptions](./puppeteer.waitfortargetoptions.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
_(Optional)_
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
**Returns:**
|
||||
|
||||
Promise<[Target](./puppeteer.target.md)>
|
||||
|
@ -12,8 +12,58 @@ export declare const enum BrowserContextEvent
|
||||
|
||||
## Enumeration Members
|
||||
|
||||
| Member | Value | Description |
|
||||
| --------------- | ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| TargetChanged | <code>"targetchanged"</code> | Emitted when the url of a target inside the browser context changes. Contains a [Target](./puppeteer.target.md) instance. |
|
||||
| TargetCreated | <code>"targetcreated"</code> | <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. |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Member
|
||||
|
||||
</th><th>
|
||||
|
||||
Value
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
TargetChanged
|
||||
|
||||
</td><td>
|
||||
|
||||
`"targetchanged"`
|
||||
|
||||
</td><td>
|
||||
|
||||
Emitted when the url of a target inside the browser context changes. Contains a [Target](./puppeteer.target.md) instance.
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
TargetCreated
|
||||
|
||||
</td><td>
|
||||
|
||||
`"targetcreated"`
|
||||
|
||||
</td><td>
|
||||
|
||||
Emitted when a target is created within the browser context, for example when a new page is opened by [window.open](https://developer.mozilla.org/en-US/docs/Web/API/Window/open) or by [browserContext.newPage](./puppeteer.browsercontext.newpage.md)
|
||||
|
||||
Contains a [Target](./puppeteer.target.md) instance.
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
TargetDestroyed
|
||||
|
||||
</td><td>
|
||||
|
||||
`"targetdestroyed"`
|
||||
|
||||
</td><td>
|
||||
|
||||
Emitted when a target is destroyed within the browser context, for example when a page is closed. Contains a [Target](./puppeteer.target.md) instance.
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
|
@ -14,8 +14,70 @@ export interface BrowserContextEvents extends Record<EventType, unknown>
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Modifiers | Type | Description | Default |
|
||||
| --------------- | --------- | ------------------------------- | ----------- | ------- |
|
||||
| targetchanged | | [Target](./puppeteer.target.md) | | |
|
||||
| targetcreated | | [Target](./puppeteer.target.md) | | |
|
||||
| targetdestroyed | | [Target](./puppeteer.target.md) | | |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Property
|
||||
|
||||
</th><th>
|
||||
|
||||
Modifiers
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th><th>
|
||||
|
||||
Default
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
targetchanged
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
[Target](./puppeteer.target.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
targetcreated
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
[Target](./puppeteer.target.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
targetdestroyed
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
[Target](./puppeteer.target.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
|
@ -12,7 +12,63 @@ export interface BrowserContextOptions
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Modifiers | Type | Description | Default |
|
||||
| --------------- | --------------------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------- | ------- |
|
||||
| proxyBypassList | <code>optional</code> | string\[\] | Bypass the proxy for the given list of hosts. | |
|
||||
| proxyServer | <code>optional</code> | string | Proxy server with optional port to use for all requests. Username and password can be set in <code>Page.authenticate</code>. | |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Property
|
||||
|
||||
</th><th>
|
||||
|
||||
Modifiers
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th><th>
|
||||
|
||||
Default
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
proxyBypassList
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
string\[\]
|
||||
|
||||
</td><td>
|
||||
|
||||
Bypass the proxy for the given list of hosts.
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
proxyServer
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
string
|
||||
|
||||
</td><td>
|
||||
|
||||
Proxy server with optional port to use for all requests. Username and password can be set in `Page.authenticate`.
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
|
@ -14,9 +14,73 @@ export declare const enum BrowserEvent
|
||||
|
||||
## Enumeration Members
|
||||
|
||||
| Member | Value | Description |
|
||||
| --------------- | ---------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Disconnected | <code>"disconnected"</code> | <p>Emitted when Puppeteer gets disconnected from the browser instance. This might happen because either:</p><p>- The browser closes/crashes or - [Browser.disconnect()](./puppeteer.browser.disconnect.md) was called.</p> |
|
||||
| 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> |
|
||||
| TargetDestroyed | <code>"targetdestroyed"</code> | Emitted when a target is destroyed, for example when a page is closed. Contains a [Target](./puppeteer.target.md) instance. |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Member
|
||||
|
||||
</th><th>
|
||||
|
||||
Value
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
Disconnected
|
||||
|
||||
</td><td>
|
||||
|
||||
`"disconnected"`
|
||||
|
||||
</td><td>
|
||||
|
||||
Emitted when Puppeteer gets disconnected from the browser instance. This might happen because either:
|
||||
|
||||
- The browser closes/crashes or - [Browser.disconnect()](./puppeteer.browser.disconnect.md) was called.
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
TargetChanged
|
||||
|
||||
</td><td>
|
||||
|
||||
`"targetchanged"`
|
||||
|
||||
</td><td>
|
||||
|
||||
Emitted when the URL of a target changes. Contains a [Target](./puppeteer.target.md) instance.
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
TargetCreated
|
||||
|
||||
</td><td>
|
||||
|
||||
`"targetcreated"`
|
||||
|
||||
</td><td>
|
||||
|
||||
Emitted when a target is created, for example when a new page is opened by [window.open](https://developer.mozilla.org/en-US/docs/Web/API/Window/open) or by [browser.newPage](./puppeteer.browser.newpage.md)
|
||||
|
||||
Contains a [Target](./puppeteer.target.md) instance.
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
TargetDestroyed
|
||||
|
||||
</td><td>
|
||||
|
||||
`"targetdestroyed"`
|
||||
|
||||
</td><td>
|
||||
|
||||
Emitted when a target is destroyed, for example when a page is closed. Contains a [Target](./puppeteer.target.md) instance.
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
|
@ -14,9 +14,85 @@ export interface BrowserEvents extends Record<EventType, unknown>
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Modifiers | Type | Description | Default |
|
||||
| --------------- | --------- | ------------------------------- | ----------- | ------- |
|
||||
| disconnected | | undefined | | |
|
||||
| targetchanged | | [Target](./puppeteer.target.md) | | |
|
||||
| targetcreated | | [Target](./puppeteer.target.md) | | |
|
||||
| targetdestroyed | | [Target](./puppeteer.target.md) | | |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Property
|
||||
|
||||
</th><th>
|
||||
|
||||
Modifiers
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th><th>
|
||||
|
||||
Default
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
disconnected
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
undefined
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
targetchanged
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
[Target](./puppeteer.target.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
targetcreated
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
[Target](./puppeteer.target.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
targetdestroyed
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
[Target](./puppeteer.target.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
|
@ -14,10 +14,124 @@ export interface BrowserLaunchArgumentOptions
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Modifiers | Type | Description | Default |
|
||||
| ------------- | --------------------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ |
|
||||
| args | <code>optional</code> | string\[\] | Additional command line arguments to pass to the browser instance. | |
|
||||
| debuggingPort | <code>optional</code> | number | Specify the debugging port number to use | |
|
||||
| devtools | <code>optional</code> | boolean | 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>. | <code>false</code> |
|
||||
| headless | <code>optional</code> | boolean \| 'shell' | Whether to run the browser in headless mode. | <code>true</code> |
|
||||
| userDataDir | <code>optional</code> | string | 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. | |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Property
|
||||
|
||||
</th><th>
|
||||
|
||||
Modifiers
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th><th>
|
||||
|
||||
Default
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
args
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
string\[\]
|
||||
|
||||
</td><td>
|
||||
|
||||
Additional command line arguments to pass to the browser instance.
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
debuggingPort
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
number
|
||||
|
||||
</td><td>
|
||||
|
||||
Specify the debugging port number to use
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
devtools
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
boolean
|
||||
|
||||
</td><td>
|
||||
|
||||
Whether to auto-open a DevTools panel for each tab. If this is set to `true`, then `headless` will be forced to `false`.
|
||||
|
||||
</td><td>
|
||||
|
||||
`false`
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
headless
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
boolean \| 'shell'
|
||||
|
||||
</td><td>
|
||||
|
||||
Whether to run the browser in headless mode.
|
||||
|
||||
</td><td>
|
||||
|
||||
`true`
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
userDataDir
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
string
|
||||
|
||||
</td><td>
|
||||
|
||||
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.
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
|
@ -39,9 +39,57 @@ await client.send('Animation.setPlaybackRate', {
|
||||
|
||||
## Methods
|
||||
|
||||
| Method | Modifiers | Description |
|
||||
| --------------------------------------------------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [connection()](./puppeteer.cdpsession.connection.md) | | |
|
||||
| [detach()](./puppeteer.cdpsession.detach.md) | | Detaches the cdpSession from the target. Once detached, the cdpSession object won't emit any events and can't be used to send messages. |
|
||||
| [id()](./puppeteer.cdpsession.id.md) | | Returns the session's id. |
|
||||
| [send(method, params, options)](./puppeteer.cdpsession.send.md) | | |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Method
|
||||
|
||||
</th><th>
|
||||
|
||||
Modifiers
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
[connection()](./puppeteer.cdpsession.connection.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[detach()](./puppeteer.cdpsession.detach.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
Detaches the cdpSession from the target. Once detached, the cdpSession object won't emit any events and can't be used to send messages.
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[id()](./puppeteer.cdpsession.id.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
Returns the session's id.
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[send(method, params, options)](./puppeteer.cdpsession.send.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
|
@ -18,12 +18,57 @@ class CDPSession {
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | -------------------------------------------------- | ------------ |
|
||||
| method | T | |
|
||||
| params | ProtocolMapping.Commands\[T\]\['paramsType'\]\[0\] | _(Optional)_ |
|
||||
| options | [CommandOptions](./puppeteer.commandoptions.md) | _(Optional)_ |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Parameter
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
method
|
||||
|
||||
</td><td>
|
||||
|
||||
T
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
params
|
||||
|
||||
</td><td>
|
||||
|
||||
ProtocolMapping.Commands\[T\]\['paramsType'\]\[0\]
|
||||
|
||||
</td><td>
|
||||
|
||||
_(Optional)_
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
options
|
||||
|
||||
</td><td>
|
||||
|
||||
[CommandOptions](./puppeteer.commandoptions.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
_(Optional)_
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
**Returns:**
|
||||
|
||||
Promise<ProtocolMapping.Commands\[T\]\['returnType'\]>
|
||||
|
@ -14,7 +14,27 @@ export declare namespace CDPSessionEvent
|
||||
|
||||
## Variables
|
||||
|
||||
| Variable | Description |
|
||||
| ----------------------------------------------------------------- | ----------- |
|
||||
| [SessionAttached](./puppeteer.cdpsessionevent.sessionattached.md) | |
|
||||
| [SessionDetached](./puppeteer.cdpsessionevent.sessiondetached.md) | |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Variable
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
[SessionAttached](./puppeteer.cdpsessionevent.sessionattached.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[SessionDetached](./puppeteer.cdpsessionevent.sessiondetached.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
|
@ -14,7 +14,55 @@ export interface CDPSessionEvents extends CDPEvents, Record<EventType, unknown>
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Modifiers | Type | Description | Default |
|
||||
| --------------- | --------- | --------------------------------------- | ----------- | ------- |
|
||||
| sessionattached | | [CDPSession](./puppeteer.cdpsession.md) | | |
|
||||
| sessiondetached | | [CDPSession](./puppeteer.cdpsession.md) | | |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Property
|
||||
|
||||
</th><th>
|
||||
|
||||
Modifiers
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th><th>
|
||||
|
||||
Default
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
sessionattached
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
[CDPSession](./puppeteer.cdpsession.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
sessiondetached
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
[CDPSession](./puppeteer.cdpsession.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
|
@ -14,6 +14,44 @@ export interface ClickOptions extends MouseClickOptions
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Modifiers | Type | Description | Default |
|
||||
| -------- | --------------------- | ------------------------------- | --------------------------------------------------------------------------------- | ------- |
|
||||
| offset | <code>optional</code> | [Offset](./puppeteer.offset.md) | Offset for the clickable point relative to the top-left corner of the border box. | |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Property
|
||||
|
||||
</th><th>
|
||||
|
||||
Modifiers
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th><th>
|
||||
|
||||
Default
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
offset
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
[Offset](./puppeteer.offset.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
Offset for the clickable point relative to the top-left corner of the border box.
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
|
@ -12,6 +12,40 @@ export interface CommandOptions
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Modifiers | Type | Description | Default |
|
||||
| -------- | --------- | ------ | ----------- | ------- |
|
||||
| timeout | | number | | |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Property
|
||||
|
||||
</th><th>
|
||||
|
||||
Modifiers
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th><th>
|
||||
|
||||
Default
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
timeout
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
number
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
|
@ -14,11 +14,42 @@ interface CommonEventEmitter {
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ------------- | ----------- |
|
||||
| type | Key | |
|
||||
| event | Events\[Key\] | |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Parameter
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
type
|
||||
|
||||
</td><td>
|
||||
|
||||
Key
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
event
|
||||
|
||||
</td><td>
|
||||
|
||||
Events\[Key\]
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
**Returns:**
|
||||
|
||||
boolean
|
||||
|
@ -14,10 +14,31 @@ interface CommonEventEmitter {
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ------------ | ----------- |
|
||||
| event | keyof Events | |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Parameter
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
event
|
||||
|
||||
</td><td>
|
||||
|
||||
keyof Events
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
**Returns:**
|
||||
|
||||
number
|
||||
|
@ -12,11 +12,55 @@ export interface CommonEventEmitter<Events extends Record<EventType, unknown>>
|
||||
|
||||
## Methods
|
||||
|
||||
| Method | Description |
|
||||
| --------------------------------------------------------------------------------- | ----------- |
|
||||
| [emit(type, event)](./puppeteer.commoneventemitter.emit.md) | |
|
||||
| [listenerCount(event)](./puppeteer.commoneventemitter.listenercount.md) | |
|
||||
| [off(type, handler)](./puppeteer.commoneventemitter.off.md) | |
|
||||
| [on(type, handler)](./puppeteer.commoneventemitter.on.md) | |
|
||||
| [once(type, handler)](./puppeteer.commoneventemitter.once.md) | |
|
||||
| [removeAllListeners(event)](./puppeteer.commoneventemitter.removealllisteners.md) | |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Method
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
[emit(type, event)](./puppeteer.commoneventemitter.emit.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[listenerCount(event)](./puppeteer.commoneventemitter.listenercount.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[off(type, handler)](./puppeteer.commoneventemitter.off.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[on(type, handler)](./puppeteer.commoneventemitter.on.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[once(type, handler)](./puppeteer.commoneventemitter.once.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[removeAllListeners(event)](./puppeteer.commoneventemitter.removealllisteners.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
|
@ -17,11 +17,44 @@ interface CommonEventEmitter {
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ------------------------------------------------------ | ------------ |
|
||||
| type | Key | |
|
||||
| handler | [Handler](./puppeteer.handler.md)<Events\[Key\]> | _(Optional)_ |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Parameter
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
type
|
||||
|
||||
</td><td>
|
||||
|
||||
Key
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
handler
|
||||
|
||||
</td><td>
|
||||
|
||||
[Handler](./puppeteer.handler.md)<Events\[Key\]>
|
||||
|
||||
</td><td>
|
||||
|
||||
_(Optional)_
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
**Returns:**
|
||||
|
||||
this
|
||||
|
@ -14,11 +14,42 @@ interface CommonEventEmitter {
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ------------------------------------------------------ | ----------- |
|
||||
| type | Key | |
|
||||
| handler | [Handler](./puppeteer.handler.md)<Events\[Key\]> | |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Parameter
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
type
|
||||
|
||||
</td><td>
|
||||
|
||||
Key
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
handler
|
||||
|
||||
</td><td>
|
||||
|
||||
[Handler](./puppeteer.handler.md)<Events\[Key\]>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
**Returns:**
|
||||
|
||||
this
|
||||
|
@ -17,11 +17,42 @@ interface CommonEventEmitter {
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ------------------------------------------------------ | ----------- |
|
||||
| type | Key | |
|
||||
| handler | [Handler](./puppeteer.handler.md)<Events\[Key\]> | |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Parameter
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
type
|
||||
|
||||
</td><td>
|
||||
|
||||
Key
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
handler
|
||||
|
||||
</td><td>
|
||||
|
||||
[Handler](./puppeteer.handler.md)<Events\[Key\]>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
**Returns:**
|
||||
|
||||
this
|
||||
|
@ -14,10 +14,33 @@ interface CommonEventEmitter {
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ------------ | ------------ |
|
||||
| event | keyof Events | _(Optional)_ |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Parameter
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
event
|
||||
|
||||
</td><td>
|
||||
|
||||
keyof Events
|
||||
|
||||
</td><td>
|
||||
|
||||
_(Optional)_
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
**Returns:**
|
||||
|
||||
this
|
||||
|
@ -16,16 +16,270 @@ export interface Configuration
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Modifiers | Type | Description | Default |
|
||||
| ------------------------------- | --------------------- | ------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| browserRevision | <code>optional</code> | string | <p>Specifies a certain version of the browser you'd like Puppeteer to use.</p><p>Can be overridden by <code>PUPPETEER_BROWSER_REVISION</code>.</p><p>See [puppeteer.launch](./puppeteer.puppeteernode.launch.md) on how executable path is inferred.</p><p>Use a specific browser version (e.g., 119.0.6045.105). If you use an alias such <code>stable</code> or <code>canary</code> it will only work during the installation of Puppeteer and it will fail when launching the browser.</p> | The pinned browser version supported by the current Puppeteer version. |
|
||||
| cacheDirectory | <code>optional</code> | string | <p>Defines the directory to be used by Puppeteer for caching.</p><p>Can be overridden by <code>PUPPETEER_CACHE_DIR</code>.</p> | <code>path.join(os.homedir(), '.cache', 'puppeteer')</code> |
|
||||
| defaultProduct | <code>optional</code> | [Product](./puppeteer.product.md) | <p>Specifies which browser you'd like Puppeteer to use.</p><p>Can be overridden by <code>PUPPETEER_PRODUCT</code>.</p> | <code>chrome</code> |
|
||||
| downloadBaseUrl | <code>optional</code> | string | <p>Specifies the URL prefix that is used to download the browser.</p><p>Can be overridden by <code>PUPPETEER_DOWNLOAD_BASE_URL</code>.</p> | Either https://storage.googleapis.com/chrome-for-testing-public or https://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central, depending on the product. |
|
||||
| executablePath | <code>optional</code> | string | <p>Specifies an executable path to be used in [puppeteer.launch](./puppeteer.puppeteernode.launch.md).</p><p>Can be overridden by <code>PUPPETEER_EXECUTABLE_PATH</code>.</p> | **Auto-computed.** |
|
||||
| experiments | <code>optional</code> | [ExperimentsConfiguration](./puppeteer.experimentsconfiguration.md) | Defines experimental options for Puppeteer. | |
|
||||
| logLevel | <code>optional</code> | 'silent' \| 'error' \| 'warn' | Tells Puppeteer to log at the given level. | <code>warn</code> |
|
||||
| skipChromeDownload | <code>optional</code> | boolean | <p>Tells Puppeteer to not Chrome download during installation.</p><p>Can be overridden by <code>PUPPETEER_SKIP_CHROME_DOWNLOAD</code>.</p> | |
|
||||
| skipChromeHeadlessShellDownload | <code>optional</code> | boolean | <p>Tells Puppeteer to not chrome-headless-shell download during installation.</p><p>Can be overridden by <code>PUPPETEER_SKIP_CHROME_HEADLESS_SHELL_DOWNLOAD</code>.</p> | |
|
||||
| skipDownload | <code>optional</code> | boolean | <p>Tells Puppeteer to not download during installation.</p><p>Can be overridden by <code>PUPPETEER_SKIP_DOWNLOAD</code>.</p> | |
|
||||
| temporaryDirectory | <code>optional</code> | string | <p>Defines the directory to be used by Puppeteer for creating temporary files.</p><p>Can be overridden by <code>PUPPETEER_TMP_DIR</code>.</p> | <code>os.tmpdir()</code> |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Property
|
||||
|
||||
</th><th>
|
||||
|
||||
Modifiers
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th><th>
|
||||
|
||||
Default
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
browserRevision
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
string
|
||||
|
||||
</td><td>
|
||||
|
||||
Specifies a certain version of the browser you'd like Puppeteer to use.
|
||||
|
||||
Can be overridden by `PUPPETEER_BROWSER_REVISION`.
|
||||
|
||||
See [puppeteer.launch](./puppeteer.puppeteernode.launch.md) on how executable path is inferred.
|
||||
|
||||
Use a specific browser version (e.g., 119.0.6045.105). If you use an alias such `stable` or `canary` it will only work during the installation of Puppeteer and it will fail when launching the browser.
|
||||
|
||||
</td><td>
|
||||
|
||||
The pinned browser version supported by the current Puppeteer version.
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
cacheDirectory
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
string
|
||||
|
||||
</td><td>
|
||||
|
||||
Defines the directory to be used by Puppeteer for caching.
|
||||
|
||||
Can be overridden by `PUPPETEER_CACHE_DIR`.
|
||||
|
||||
</td><td>
|
||||
|
||||
`path.join(os.homedir(), '.cache', 'puppeteer')`
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
defaultProduct
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
[Product](./puppeteer.product.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
Specifies which browser you'd like Puppeteer to use.
|
||||
|
||||
Can be overridden by `PUPPETEER_PRODUCT`.
|
||||
|
||||
</td><td>
|
||||
|
||||
`chrome`
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
downloadBaseUrl
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
string
|
||||
|
||||
</td><td>
|
||||
|
||||
Specifies the URL prefix that is used to download the browser.
|
||||
|
||||
Can be overridden by `PUPPETEER_DOWNLOAD_BASE_URL`.
|
||||
|
||||
</td><td>
|
||||
|
||||
Either https://storage.googleapis.com/chrome-for-testing-public or https://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central, depending on the product.
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
executablePath
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
string
|
||||
|
||||
</td><td>
|
||||
|
||||
Specifies an executable path to be used in [puppeteer.launch](./puppeteer.puppeteernode.launch.md).
|
||||
|
||||
Can be overridden by `PUPPETEER_EXECUTABLE_PATH`.
|
||||
|
||||
</td><td>
|
||||
|
||||
**Auto-computed.**
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
experiments
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
[ExperimentsConfiguration](./puppeteer.experimentsconfiguration.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
Defines experimental options for Puppeteer.
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
logLevel
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
'silent' \| 'error' \| 'warn'
|
||||
|
||||
</td><td>
|
||||
|
||||
Tells Puppeteer to log at the given level.
|
||||
|
||||
</td><td>
|
||||
|
||||
`warn`
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
skipChromeDownload
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
boolean
|
||||
|
||||
</td><td>
|
||||
|
||||
Tells Puppeteer to not Chrome download during installation.
|
||||
|
||||
Can be overridden by `PUPPETEER_SKIP_CHROME_DOWNLOAD`.
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
skipChromeHeadlessShellDownload
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
boolean
|
||||
|
||||
</td><td>
|
||||
|
||||
Tells Puppeteer to not chrome-headless-shell download during installation.
|
||||
|
||||
Can be overridden by `PUPPETEER_SKIP_CHROME_HEADLESS_SHELL_DOWNLOAD`.
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
skipDownload
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
boolean
|
||||
|
||||
</td><td>
|
||||
|
||||
Tells Puppeteer to not download during installation.
|
||||
|
||||
Can be overridden by `PUPPETEER_SKIP_DOWNLOAD`.
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
temporaryDirectory
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
string
|
||||
|
||||
</td><td>
|
||||
|
||||
Defines the directory to be used by Puppeteer for creating temporary files.
|
||||
|
||||
Can be overridden by `PUPPETEER_TMP_DIR`.
|
||||
|
||||
</td><td>
|
||||
|
||||
`os.tmpdir()`
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
|
@ -14,10 +14,31 @@ connect: (
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | --------------------------------------------------------------------------------------------------- | ----------- |
|
||||
| options | import("puppeteer-core/internal/puppeteer-core.js").[ConnectOptions](./puppeteer.connectoptions.md) | |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Parameter
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
options
|
||||
|
||||
</td><td>
|
||||
|
||||
import("puppeteer-core/internal/puppeteer-core.js").[ConnectOptions](./puppeteer.connectoptions.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
**Returns:**
|
||||
|
||||
Promise<import("puppeteer-core/internal/puppeteer-core.js").[Browser](./puppeteer.browser.md)>
|
||||
|
@ -21,9 +21,65 @@ class Connection {
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | --------------------------------------------------------- | ------------ |
|
||||
| url | string | |
|
||||
| transport | [ConnectionTransport](./puppeteer.connectiontransport.md) | |
|
||||
| delay | number | _(Optional)_ |
|
||||
| timeout | number | _(Optional)_ |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Parameter
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
url
|
||||
|
||||
</td><td>
|
||||
|
||||
string
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
transport
|
||||
|
||||
</td><td>
|
||||
|
||||
[ConnectionTransport](./puppeteer.connectiontransport.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
delay
|
||||
|
||||
</td><td>
|
||||
|
||||
number
|
||||
|
||||
</td><td>
|
||||
|
||||
_(Optional)_
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
timeout
|
||||
|
||||
</td><td>
|
||||
|
||||
number
|
||||
|
||||
</td><td>
|
||||
|
||||
_(Optional)_
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
|
@ -14,10 +14,33 @@ class Connection {
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| ---------- | -------------------------- | --------------- |
|
||||
| targetInfo | Protocol.Target.TargetInfo | The target info |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Parameter
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
targetInfo
|
||||
|
||||
</td><td>
|
||||
|
||||
Protocol.Target.TargetInfo
|
||||
|
||||
</td><td>
|
||||
|
||||
The target info
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
**Returns:**
|
||||
|
||||
Promise<[CDPSession](./puppeteer.cdpsession.md)>
|
||||
|
@ -14,10 +14,31 @@ class Connection {
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | --------------------------------------- | ----------- |
|
||||
| session | [CDPSession](./puppeteer.cdpsession.md) | |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Parameter
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
session
|
||||
|
||||
</td><td>
|
||||
|
||||
[CDPSession](./puppeteer.cdpsession.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
**Returns:**
|
||||
|
||||
[Connection](./puppeteer.connection.md) \| undefined
|
||||
|
@ -14,23 +14,137 @@ export declare class Connection extends EventEmitter<CDPSessionEvents>
|
||||
|
||||
## Constructors
|
||||
|
||||
| Constructor | Modifiers | Description |
|
||||
| ---------------------------------------------------------------------------------------- | --------- | -------------------------------------------------------------- |
|
||||
| [(constructor)(url, transport, delay, timeout)](./puppeteer.connection._constructor_.md) | | Constructs a new instance of the <code>Connection</code> class |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Constructor
|
||||
|
||||
</th><th>
|
||||
|
||||
Modifiers
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
[(constructor)(url, transport, delay, timeout)](./puppeteer.connection._constructor_.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
Constructs a new instance of the `Connection` class
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Modifiers | Type | Description |
|
||||
| -------- | --------------------- | ------ | ----------- |
|
||||
| timeout | <code>readonly</code> | number | |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Property
|
||||
|
||||
</th><th>
|
||||
|
||||
Modifiers
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
timeout
|
||||
|
||||
</td><td>
|
||||
|
||||
`readonly`
|
||||
|
||||
</td><td>
|
||||
|
||||
number
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
|
||||
## Methods
|
||||
|
||||
| Method | Modifiers | Description |
|
||||
| -------------------------------------------------------------------- | ------------------- | ----------- |
|
||||
| [createSession(targetInfo)](./puppeteer.connection.createsession.md) | | |
|
||||
| [dispose()](./puppeteer.connection.dispose.md) | | |
|
||||
| [fromSession(session)](./puppeteer.connection.fromsession.md) | <code>static</code> | |
|
||||
| [send(method, params, options)](./puppeteer.connection.send.md) | | |
|
||||
| [session(sessionId)](./puppeteer.connection.session.md) | | |
|
||||
| [url()](./puppeteer.connection.url.md) | | |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Method
|
||||
|
||||
</th><th>
|
||||
|
||||
Modifiers
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
[createSession(targetInfo)](./puppeteer.connection.createsession.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[dispose()](./puppeteer.connection.dispose.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[fromSession(session)](./puppeteer.connection.fromsession.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
`static`
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[send(method, params, options)](./puppeteer.connection.send.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[session(sessionId)](./puppeteer.connection.session.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[url()](./puppeteer.connection.url.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
|
@ -18,12 +18,57 @@ class Connection {
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | -------------------------------------------------- | ------------ |
|
||||
| method | T | |
|
||||
| params | ProtocolMapping.Commands\[T\]\['paramsType'\]\[0\] | _(Optional)_ |
|
||||
| options | [CommandOptions](./puppeteer.commandoptions.md) | _(Optional)_ |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Parameter
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
method
|
||||
|
||||
</td><td>
|
||||
|
||||
T
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
params
|
||||
|
||||
</td><td>
|
||||
|
||||
ProtocolMapping.Commands\[T\]\['paramsType'\]\[0\]
|
||||
|
||||
</td><td>
|
||||
|
||||
_(Optional)_
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
options
|
||||
|
||||
</td><td>
|
||||
|
||||
[CommandOptions](./puppeteer.commandoptions.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
_(Optional)_
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
**Returns:**
|
||||
|
||||
Promise<ProtocolMapping.Commands\[T\]\['returnType'\]>
|
||||
|
@ -14,10 +14,33 @@ class Connection {
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ------ | -------------- |
|
||||
| sessionId | string | The session id |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Parameter
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
sessionId
|
||||
|
||||
</td><td>
|
||||
|
||||
string
|
||||
|
||||
</td><td>
|
||||
|
||||
The session id
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
**Returns:**
|
||||
|
||||
[CDPSession](./puppeteer.cdpsession.md) \| null
|
||||
|
@ -12,14 +12,86 @@ export interface ConnectionTransport
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Modifiers | Type | Description | Default |
|
||||
| --------- | --------------------- | ---------------------------- | ----------- | ------- |
|
||||
| onclose | <code>optional</code> | () => void | | |
|
||||
| onmessage | <code>optional</code> | (message: string) => void | | |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Property
|
||||
|
||||
</th><th>
|
||||
|
||||
Modifiers
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th><th>
|
||||
|
||||
Default
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
onclose
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
() => void
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
onmessage
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
(message: string) => void
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
|
||||
## Methods
|
||||
|
||||
| Method | Description |
|
||||
| -------------------------------------------------------- | ----------- |
|
||||
| [close()](./puppeteer.connectiontransport.close.md) | |
|
||||
| [send(message)](./puppeteer.connectiontransport.send.md) | |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Method
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
[close()](./puppeteer.connectiontransport.close.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[send(message)](./puppeteer.connectiontransport.send.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
|
@ -14,10 +14,31 @@ interface ConnectionTransport {
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ------ | ----------- |
|
||||
| message | string | |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Parameter
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
message
|
||||
|
||||
</td><td>
|
||||
|
||||
string
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
**Returns:**
|
||||
|
||||
void
|
||||
|
@ -14,9 +14,95 @@ export interface ConnectOptions extends BrowserConnectOptions
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Modifiers | Type | Description | Default |
|
||||
| ----------------- | --------------------- | --------------------------------------------------------- | --------------------------------------------- | ------- |
|
||||
| browserURL | <code>optional</code> | string | | |
|
||||
| browserWSEndpoint | <code>optional</code> | string | | |
|
||||
| headers | <code>optional</code> | Record<string, string> | Headers to use for the web socket connection. | |
|
||||
| transport | <code>optional</code> | [ConnectionTransport](./puppeteer.connectiontransport.md) | | |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Property
|
||||
|
||||
</th><th>
|
||||
|
||||
Modifiers
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th><th>
|
||||
|
||||
Default
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
browserURL
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
string
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
browserWSEndpoint
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
string
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
headers
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
Record<string, string>
|
||||
|
||||
</td><td>
|
||||
|
||||
Headers to use for the web socket connection.
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
transport
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
[ConnectionTransport](./puppeteer.connectiontransport.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
|
@ -21,9 +21,61 @@ class ConsoleMessage {
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| ------------------- | ------------------------------------------------------------------- | ----------- |
|
||||
| type | [ConsoleMessageType](./puppeteer.consolemessagetype.md) | |
|
||||
| text | string | |
|
||||
| args | [JSHandle](./puppeteer.jshandle.md)\[\] | |
|
||||
| stackTraceLocations | [ConsoleMessageLocation](./puppeteer.consolemessagelocation.md)\[\] | |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Parameter
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
type
|
||||
|
||||
</td><td>
|
||||
|
||||
[ConsoleMessageType](./puppeteer.consolemessagetype.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
text
|
||||
|
||||
</td><td>
|
||||
|
||||
string
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
args
|
||||
|
||||
</td><td>
|
||||
|
||||
[JSHandle](./puppeteer.jshandle.md)\[\]
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
stackTraceLocations
|
||||
|
||||
</td><td>
|
||||
|
||||
[ConsoleMessageLocation](./puppeteer.consolemessagelocation.md)\[\]
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
|
@ -14,16 +14,100 @@ export declare class ConsoleMessage
|
||||
|
||||
## Constructors
|
||||
|
||||
| Constructor | Modifiers | Description |
|
||||
| --------------------------------------------------------------------------------------------------- | --------- | ------------------------------------------------------------------ |
|
||||
| [(constructor)(type, text, args, stackTraceLocations)](./puppeteer.consolemessage._constructor_.md) | | Constructs a new instance of the <code>ConsoleMessage</code> class |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Constructor
|
||||
|
||||
</th><th>
|
||||
|
||||
Modifiers
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
[(constructor)(type, text, args, stackTraceLocations)](./puppeteer.consolemessage._constructor_.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
Constructs a new instance of the `ConsoleMessage` class
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
|
||||
## Methods
|
||||
|
||||
| Method | Modifiers | Description |
|
||||
| -------------------------------------------------------- | --------- | ----------------------------------------------------------- |
|
||||
| [args()](./puppeteer.consolemessage.args.md) | | An array of arguments passed to the console. |
|
||||
| [location()](./puppeteer.consolemessage.location.md) | | The location of the console message. |
|
||||
| [stackTrace()](./puppeteer.consolemessage.stacktrace.md) | | The array of locations on the stack of the console message. |
|
||||
| [text()](./puppeteer.consolemessage.text.md) | | The text of the console message. |
|
||||
| [type()](./puppeteer.consolemessage.type.md) | | The type of the console message. |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Method
|
||||
|
||||
</th><th>
|
||||
|
||||
Modifiers
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
[args()](./puppeteer.consolemessage.args.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
An array of arguments passed to the console.
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[location()](./puppeteer.consolemessage.location.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
The location of the console message.
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[stackTrace()](./puppeteer.consolemessage.stacktrace.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
The array of locations on the stack of the console message.
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[text()](./puppeteer.consolemessage.text.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
The text of the console message.
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[type()](./puppeteer.consolemessage.type.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
The type of the console message.
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
|
@ -12,8 +12,82 @@ export interface ConsoleMessageLocation
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Modifiers | Type | Description | Default |
|
||||
| ------------ | --------------------- | ------ | ----------------------------------------------------------------------------------- | ------- |
|
||||
| columnNumber | <code>optional</code> | number | 0-based column number in the resource if known or <code>undefined</code> otherwise. | |
|
||||
| lineNumber | <code>optional</code> | number | 0-based line number in the resource if known or <code>undefined</code> otherwise. | |
|
||||
| url | <code>optional</code> | string | URL of the resource if known or <code>undefined</code> otherwise. | |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Property
|
||||
|
||||
</th><th>
|
||||
|
||||
Modifiers
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th><th>
|
||||
|
||||
Default
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
columnNumber
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
number
|
||||
|
||||
</td><td>
|
||||
|
||||
0-based column number in the resource if known or `undefined` otherwise.
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
lineNumber
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
number
|
||||
|
||||
</td><td>
|
||||
|
||||
0-based line number in the resource if known or `undefined` otherwise.
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
url
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
string
|
||||
|
||||
</td><td>
|
||||
|
||||
URL of the resource if known or `undefined` otherwise.
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
|
@ -12,9 +12,95 @@ export interface ContinueRequestOverrides
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Modifiers | Type | Description | Default |
|
||||
| -------- | --------------------- | ---------------------------- | ------------------------------------------------------------ | ------- |
|
||||
| headers | <code>optional</code> | Record<string, string> | | |
|
||||
| method | <code>optional</code> | string | | |
|
||||
| postData | <code>optional</code> | string | | |
|
||||
| url | <code>optional</code> | string | If set, the request URL will change. This is not a redirect. | |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Property
|
||||
|
||||
</th><th>
|
||||
|
||||
Modifiers
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th><th>
|
||||
|
||||
Default
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
headers
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
Record<string, string>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
method
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
string
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
postData
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
string
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
url
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
string
|
||||
|
||||
</td><td>
|
||||
|
||||
If set, the request URL will change. This is not a redirect.
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
|
@ -14,20 +14,292 @@ export interface Cookie
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Modifiers | Type | Description | Default |
|
||||
| ------------------ | --------------------- | ------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
|
||||
| domain | | string | Cookie domain. | |
|
||||
| expires | | number | Cookie expiration date as the number of seconds since the UNIX epoch. Set to <code>-1</code> for session cookies | |
|
||||
| httpOnly | | boolean | True if cookie is http-only. | |
|
||||
| name | | string | Cookie name. | |
|
||||
| partitionKey | <code>optional</code> | string | Cookie partition key. The site of the top-level URL the browser was visiting at the start of the request to the endpoint that set the cookie. Supported only in Chrome. | |
|
||||
| partitionKeyOpaque | <code>optional</code> | boolean | True if cookie partition key is opaque. Supported only in Chrome. | |
|
||||
| path | | string | Cookie path. | |
|
||||
| priority | <code>optional</code> | [CookiePriority](./puppeteer.cookiepriority.md) | Cookie Priority. Supported only in Chrome. | |
|
||||
| sameParty | <code>optional</code> | boolean | True if cookie is SameParty. Supported only in Chrome. | |
|
||||
| sameSite | <code>optional</code> | [CookieSameSite](./puppeteer.cookiesamesite.md) | Cookie SameSite type. | |
|
||||
| secure | | boolean | True if cookie is secure. | |
|
||||
| session | | boolean | True in case of session cookie. | |
|
||||
| size | | number | Cookie size. | |
|
||||
| sourceScheme | <code>optional</code> | [CookieSourceScheme](./puppeteer.cookiesourcescheme.md) | Cookie source scheme type. Supported only in Chrome. | |
|
||||
| value | | string | Cookie value. | |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Property
|
||||
|
||||
</th><th>
|
||||
|
||||
Modifiers
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th><th>
|
||||
|
||||
Default
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
domain
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
string
|
||||
|
||||
</td><td>
|
||||
|
||||
Cookie domain.
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
expires
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
number
|
||||
|
||||
</td><td>
|
||||
|
||||
Cookie expiration date as the number of seconds since the UNIX epoch. Set to `-1` for session cookies
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
httpOnly
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
boolean
|
||||
|
||||
</td><td>
|
||||
|
||||
True if cookie is http-only.
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
name
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
string
|
||||
|
||||
</td><td>
|
||||
|
||||
Cookie name.
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
partitionKey
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
string
|
||||
|
||||
</td><td>
|
||||
|
||||
Cookie partition key. The site of the top-level URL the browser was visiting at the start of the request to the endpoint that set the cookie. Supported only in Chrome.
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
partitionKeyOpaque
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
boolean
|
||||
|
||||
</td><td>
|
||||
|
||||
True if cookie partition key is opaque. Supported only in Chrome.
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
path
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
string
|
||||
|
||||
</td><td>
|
||||
|
||||
Cookie path.
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
priority
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
[CookiePriority](./puppeteer.cookiepriority.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
Cookie Priority. Supported only in Chrome.
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
sameParty
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
boolean
|
||||
|
||||
</td><td>
|
||||
|
||||
True if cookie is SameParty. Supported only in Chrome.
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
sameSite
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
[CookieSameSite](./puppeteer.cookiesamesite.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
Cookie SameSite type.
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
secure
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
boolean
|
||||
|
||||
</td><td>
|
||||
|
||||
True if cookie is secure.
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
session
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
boolean
|
||||
|
||||
</td><td>
|
||||
|
||||
True in case of session cookie.
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
size
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
number
|
||||
|
||||
</td><td>
|
||||
|
||||
Cookie size.
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
sourceScheme
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
[CookieSourceScheme](./puppeteer.cookiesourcescheme.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
Cookie source scheme type. Supported only in Chrome.
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
value
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
string
|
||||
|
||||
</td><td>
|
||||
|
||||
Cookie value.
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
|
@ -14,18 +14,268 @@ export interface CookieParam
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Modifiers | Type | Description | Default |
|
||||
| ------------ | --------------------- | ------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
|
||||
| domain | <code>optional</code> | string | Cookie domain. | |
|
||||
| expires | <code>optional</code> | number | Cookie expiration date, session cookie if not set | |
|
||||
| httpOnly | <code>optional</code> | boolean | True if cookie is http-only. | |
|
||||
| name | | string | Cookie name. | |
|
||||
| partitionKey | <code>optional</code> | string | Cookie partition key. The site of the top-level URL the browser was visiting at the start of the request to the endpoint that set the cookie. If not set, the cookie will be set as not partitioned. | |
|
||||
| path | <code>optional</code> | string | Cookie path. | |
|
||||
| priority | <code>optional</code> | [CookiePriority](./puppeteer.cookiepriority.md) | Cookie Priority. Supported only in Chrome. | |
|
||||
| sameParty | <code>optional</code> | boolean | True if cookie is SameParty. Supported only in Chrome. | |
|
||||
| sameSite | <code>optional</code> | [CookieSameSite](./puppeteer.cookiesamesite.md) | Cookie SameSite type. | |
|
||||
| secure | <code>optional</code> | boolean | True if cookie is secure. | |
|
||||
| sourceScheme | <code>optional</code> | [CookieSourceScheme](./puppeteer.cookiesourcescheme.md) | Cookie source scheme type. Supported only in Chrome. | |
|
||||
| url | <code>optional</code> | string | The request-URI to associate with the setting of the cookie. This value can affect the default domain, path, and source scheme values of the created cookie. | |
|
||||
| value | | string | Cookie value. | |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Property
|
||||
|
||||
</th><th>
|
||||
|
||||
Modifiers
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th><th>
|
||||
|
||||
Default
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
domain
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
string
|
||||
|
||||
</td><td>
|
||||
|
||||
Cookie domain.
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
expires
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
number
|
||||
|
||||
</td><td>
|
||||
|
||||
Cookie expiration date, session cookie if not set
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
httpOnly
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
boolean
|
||||
|
||||
</td><td>
|
||||
|
||||
True if cookie is http-only.
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
name
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
string
|
||||
|
||||
</td><td>
|
||||
|
||||
Cookie name.
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
partitionKey
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
string
|
||||
|
||||
</td><td>
|
||||
|
||||
Cookie partition key. The site of the top-level URL the browser was visiting at the start of the request to the endpoint that set the cookie. If not set, the cookie will be set as not partitioned.
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
path
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
string
|
||||
|
||||
</td><td>
|
||||
|
||||
Cookie path.
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
priority
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
[CookiePriority](./puppeteer.cookiepriority.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
Cookie Priority. Supported only in Chrome.
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
sameParty
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
boolean
|
||||
|
||||
</td><td>
|
||||
|
||||
True if cookie is SameParty. Supported only in Chrome.
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
sameSite
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
[CookieSameSite](./puppeteer.cookiesamesite.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
Cookie SameSite type.
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
secure
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
boolean
|
||||
|
||||
</td><td>
|
||||
|
||||
True if cookie is secure.
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
sourceScheme
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
[CookieSourceScheme](./puppeteer.cookiesourcescheme.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
Cookie source scheme type. Supported only in Chrome.
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
url
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
string
|
||||
|
||||
</td><td>
|
||||
|
||||
The request-URI to associate with the setting of the cookie. This value can affect the default domain, path, and source scheme values of the created cookie.
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
value
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
string
|
||||
|
||||
</td><td>
|
||||
|
||||
Cookie value.
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
|
@ -16,6 +16,28 @@ class Coverage {
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | --------------------------------------- | ----------- |
|
||||
| client | [CDPSession](./puppeteer.cdpsession.md) | |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Parameter
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
client
|
||||
|
||||
</td><td>
|
||||
|
||||
[CDPSession](./puppeteer.cdpsession.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
|
@ -45,15 +45,85 @@ console.log(`Bytes used: ${(usedBytes / totalBytes) * 100}%`);
|
||||
|
||||
## Constructors
|
||||
|
||||
| Constructor | Modifiers | Description |
|
||||
| -------------------------------------------------------------- | --------- | ------------------------------------------------------------ |
|
||||
| [(constructor)(client)](./puppeteer.coverage._constructor_.md) | | Constructs a new instance of the <code>Coverage</code> class |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Constructor
|
||||
|
||||
</th><th>
|
||||
|
||||
Modifiers
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
[(constructor)(client)](./puppeteer.coverage._constructor_.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
Constructs a new instance of the `Coverage` class
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
|
||||
## Methods
|
||||
|
||||
| Method | Modifiers | Description |
|
||||
| --------------------------------------------------------------------- | --------- | --------------------------------------------------------------------------- |
|
||||
| [startCSSCoverage(options)](./puppeteer.coverage.startcsscoverage.md) | | |
|
||||
| [startJSCoverage(options)](./puppeteer.coverage.startjscoverage.md) | | |
|
||||
| [stopCSSCoverage()](./puppeteer.coverage.stopcsscoverage.md) | | Promise that resolves to the array of coverage reports for all stylesheets. |
|
||||
| [stopJSCoverage()](./puppeteer.coverage.stopjscoverage.md) | | Promise that resolves to the array of coverage reports for all scripts. |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Method
|
||||
|
||||
</th><th>
|
||||
|
||||
Modifiers
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
[startCSSCoverage(options)](./puppeteer.coverage.startcsscoverage.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[startJSCoverage(options)](./puppeteer.coverage.startjscoverage.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[stopCSSCoverage()](./puppeteer.coverage.stopcsscoverage.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
Promise that resolves to the array of coverage reports for all stylesheets.
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[stopJSCoverage()](./puppeteer.coverage.stopjscoverage.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
Promise that resolves to the array of coverage reports for all scripts.
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
|
@ -14,10 +14,33 @@ class Coverage {
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
|
||||
| options | [CSSCoverageOptions](./puppeteer.csscoverageoptions.md) | _(Optional)_ Set of configurable options for coverage, defaults to <code>resetOnNavigation : true</code> |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Parameter
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
options
|
||||
|
||||
</td><td>
|
||||
|
||||
[CSSCoverageOptions](./puppeteer.csscoverageoptions.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
_(Optional)_ Set of configurable options for coverage, defaults to `resetOnNavigation : true`
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
**Returns:**
|
||||
|
||||
Promise<void>
|
||||
|
@ -14,10 +14,33 @@ class Coverage {
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ----------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| options | [JSCoverageOptions](./puppeteer.jscoverageoptions.md) | _(Optional)_ Set of configurable options for coverage defaults to <code>resetOnNavigation : true, reportAnonymousScripts : false,</code> <code>includeRawScriptCoverage : false, useBlockCoverage : true</code> |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Parameter
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
options
|
||||
|
||||
</td><td>
|
||||
|
||||
[JSCoverageOptions](./puppeteer.jscoverageoptions.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
_(Optional)_ Set of configurable options for coverage defaults to `resetOnNavigation : true, reportAnonymousScripts : false,` `includeRawScriptCoverage : false, useBlockCoverage : true`
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
**Returns:**
|
||||
|
||||
Promise<void>
|
||||
|
@ -14,8 +14,76 @@ export interface CoverageEntry
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Modifiers | Type | Description | Default |
|
||||
| -------- | --------- | ------------------------------------------------------ | --------------------------------------------- | ------- |
|
||||
| ranges | | Array<{ start: number; end: number; }> | The covered range as start and end positions. | |
|
||||
| text | | string | The content of the style sheet or script. | |
|
||||
| url | | string | The URL of the style sheet or script. | |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Property
|
||||
|
||||
</th><th>
|
||||
|
||||
Modifiers
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th><th>
|
||||
|
||||
Default
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
ranges
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
Array<{ start: number; end: number; }>
|
||||
|
||||
</td><td>
|
||||
|
||||
The covered range as start and end positions.
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
text
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
string
|
||||
|
||||
</td><td>
|
||||
|
||||
The content of the style sheet or script.
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
url
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
string
|
||||
|
||||
</td><td>
|
||||
|
||||
The URL of the style sheet or script.
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
|
@ -12,7 +12,55 @@ export interface Credentials
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Modifiers | Type | Description | Default |
|
||||
| -------- | --------- | ------ | ----------- | ------- |
|
||||
| password | | string | | |
|
||||
| username | | string | | |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Property
|
||||
|
||||
</th><th>
|
||||
|
||||
Modifiers
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th><th>
|
||||
|
||||
Default
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
password
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
string
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
username
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
string
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
|
@ -16,6 +16,28 @@ class CSSCoverage {
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | --------------------------------------- | ----------- |
|
||||
| client | [CDPSession](./puppeteer.cdpsession.md) | |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Parameter
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
client
|
||||
|
||||
</td><td>
|
||||
|
||||
[CDPSession](./puppeteer.cdpsession.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
|
@ -12,13 +12,63 @@ export declare class CSSCoverage
|
||||
|
||||
## Constructors
|
||||
|
||||
| Constructor | Modifiers | Description |
|
||||
| ----------------------------------------------------------------- | --------- | --------------------------------------------------------------- |
|
||||
| [(constructor)(client)](./puppeteer.csscoverage._constructor_.md) | | Constructs a new instance of the <code>CSSCoverage</code> class |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Constructor
|
||||
|
||||
</th><th>
|
||||
|
||||
Modifiers
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
[(constructor)(client)](./puppeteer.csscoverage._constructor_.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
Constructs a new instance of the `CSSCoverage` class
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
|
||||
## Methods
|
||||
|
||||
| Method | Modifiers | Description |
|
||||
| -------------------------------------------------- | --------- | ----------- |
|
||||
| [start(options)](./puppeteer.csscoverage.start.md) | | |
|
||||
| [stop()](./puppeteer.csscoverage.stop.md) | | |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Method
|
||||
|
||||
</th><th>
|
||||
|
||||
Modifiers
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
[start(options)](./puppeteer.csscoverage.start.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[stop()](./puppeteer.csscoverage.stop.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
|
@ -14,10 +14,33 @@ class CSSCoverage {
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ------------------------------------------ | ------------ |
|
||||
| options | { resetOnNavigation?: boolean; } | _(Optional)_ |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Parameter
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
options
|
||||
|
||||
</td><td>
|
||||
|
||||
{ resetOnNavigation?: boolean; }
|
||||
|
||||
</td><td>
|
||||
|
||||
_(Optional)_
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
**Returns:**
|
||||
|
||||
Promise<void>
|
||||
|
@ -14,6 +14,44 @@ export interface CSSCoverageOptions
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Modifiers | Type | Description | Default |
|
||||
| ----------------- | --------------------- | ------- | ---------------------------------------------- | ------- |
|
||||
| resetOnNavigation | <code>optional</code> | boolean | Whether to reset coverage on every navigation. | |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Property
|
||||
|
||||
</th><th>
|
||||
|
||||
Modifiers
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th><th>
|
||||
|
||||
Default
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
resetOnNavigation
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
boolean
|
||||
|
||||
</td><td>
|
||||
|
||||
Whether to reset coverage on every navigation.
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
|
@ -12,7 +12,63 @@ export interface CustomQueryHandler
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Modifiers | Type | Description | Default |
|
||||
| -------- | --------------------- | --------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
|
||||
| queryAll | <code>optional</code> | (node: Node, selector: string) => Iterable<Node> | Searches for some [Nodes](https://developer.mozilla.org/en-US/docs/Web/API/Node) matching the given <code>selector</code> from [node](https://developer.mozilla.org/en-US/docs/Web/API/Node). | |
|
||||
| queryOne | <code>optional</code> | (node: Node, selector: string) => Node \| null | Searches for a [Node](https://developer.mozilla.org/en-US/docs/Web/API/Node) matching the given <code>selector</code> from [node](https://developer.mozilla.org/en-US/docs/Web/API/Node). | |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Property
|
||||
|
||||
</th><th>
|
||||
|
||||
Modifiers
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th><th>
|
||||
|
||||
Default
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
queryAll
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
(node: Node, selector: string) => Iterable<Node>
|
||||
|
||||
</td><td>
|
||||
|
||||
Searches for some [Nodes](https://developer.mozilla.org/en-US/docs/Web/API/Node) matching the given `selector` from [node](https://developer.mozilla.org/en-US/docs/Web/API/Node).
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
queryOne
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
(node: Node, selector: string) => Node \| null
|
||||
|
||||
</td><td>
|
||||
|
||||
Searches for a [Node](https://developer.mozilla.org/en-US/docs/Web/API/Node) matching the given `selector` from [node](https://developer.mozilla.org/en-US/docs/Web/API/Node).
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
|
@ -12,6 +12,40 @@ export interface DebugInfo
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Modifiers | Type | Description | Default |
|
||||
| --------------------- | --------- | --------- | ----------- | ------- |
|
||||
| pendingProtocolErrors | | Error\[\] | | |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Property
|
||||
|
||||
</th><th>
|
||||
|
||||
Modifiers
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th><th>
|
||||
|
||||
Default
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
pendingProtocolErrors
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
Error\[\]
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
|
@ -12,10 +12,33 @@ defaultArgs: (options?: import("puppeteer-core/internal/puppeteer-core.js").Brow
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | -------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
|
||||
| options | import("puppeteer-core/internal/puppeteer-core.js").[BrowserLaunchArgumentOptions](./puppeteer.browserlaunchargumentoptions.md) \| undefined | _(Optional)_ |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Parameter
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
options
|
||||
|
||||
</td><td>
|
||||
|
||||
import("puppeteer-core/internal/puppeteer-core.js").[BrowserLaunchArgumentOptions](./puppeteer.browserlaunchargumentoptions.md) \| undefined
|
||||
|
||||
</td><td>
|
||||
|
||||
_(Optional)_
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
**Returns:**
|
||||
|
||||
string\[\]
|
||||
|
@ -12,9 +12,99 @@ export interface DeleteCookiesRequest
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Modifiers | Type | Description | Default |
|
||||
| -------- | --------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
|
||||
| domain | <code>optional</code> | string | If specified, deletes only cookies with the exact domain. | |
|
||||
| name | | string | Name of the cookies to remove. | |
|
||||
| path | <code>optional</code> | string | If specified, deletes only cookies with the exact path. | |
|
||||
| url | <code>optional</code> | string | If specified, deletes all the cookies with the given name where domain and path match provided URL. Otherwise, deletes only cookies related to the current page's domain. | |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Property
|
||||
|
||||
</th><th>
|
||||
|
||||
Modifiers
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th><th>
|
||||
|
||||
Default
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
domain
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
string
|
||||
|
||||
</td><td>
|
||||
|
||||
If specified, deletes only cookies with the exact domain.
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
name
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
string
|
||||
|
||||
</td><td>
|
||||
|
||||
Name of the cookies to remove.
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
path
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
string
|
||||
|
||||
</td><td>
|
||||
|
||||
If specified, deletes only cookies with the exact path.
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
url
|
||||
|
||||
</td><td>
|
||||
|
||||
`optional`
|
||||
|
||||
</td><td>
|
||||
|
||||
string
|
||||
|
||||
</td><td>
|
||||
|
||||
If specified, deletes all the cookies with the given name where domain and path match provided URL. Otherwise, deletes only cookies related to the current page's domain.
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
|
@ -12,7 +12,55 @@ export interface Device
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Modifiers | Type | Description | Default |
|
||||
| --------- | --------- | ----------------------------------- | ----------- | ------- |
|
||||
| userAgent | | string | | |
|
||||
| viewport | | [Viewport](./puppeteer.viewport.md) | | |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Property
|
||||
|
||||
</th><th>
|
||||
|
||||
Modifiers
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th><th>
|
||||
|
||||
Default
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
userAgent
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
string
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
viewport
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
[Viewport](./puppeteer.viewport.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
|
@ -32,14 +32,86 @@ await devicePrompt.select(
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Modifiers | Type | Description |
|
||||
| -------- | --------- | ------------------------------------------------------------------------- | ----------------------------------- |
|
||||
| devices | | [DeviceRequestPromptDevice](./puppeteer.devicerequestpromptdevice.md)\[\] | Current list of selectable devices. |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Property
|
||||
|
||||
</th><th>
|
||||
|
||||
Modifiers
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
devices
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
[DeviceRequestPromptDevice](./puppeteer.devicerequestpromptdevice.md)\[\]
|
||||
|
||||
</td><td>
|
||||
|
||||
Current list of selectable devices.
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
|
||||
## Methods
|
||||
|
||||
| Method | Modifiers | Description |
|
||||
| ---------------------------------------------------------------------------------- | --------- | ------------------------------------------------------------ |
|
||||
| [cancel()](./puppeteer.devicerequestprompt.cancel.md) | | Cancel the prompt. |
|
||||
| [select(device)](./puppeteer.devicerequestprompt.select.md) | | Select a device in the prompt's list. |
|
||||
| [waitForDevice(filter, options)](./puppeteer.devicerequestprompt.waitfordevice.md) | | Resolve to the first device in the prompt matching a filter. |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Method
|
||||
|
||||
</th><th>
|
||||
|
||||
Modifiers
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
[cancel()](./puppeteer.devicerequestprompt.cancel.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
Cancel the prompt.
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[select(device)](./puppeteer.devicerequestprompt.select.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
Select a device in the prompt's list.
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[waitForDevice(filter, options)](./puppeteer.devicerequestprompt.waitfordevice.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
Resolve to the first device in the prompt matching a filter.
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
|
@ -16,10 +16,31 @@ class DeviceRequestPrompt {
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | --------------------------------------------------------------------- | ----------- |
|
||||
| device | [DeviceRequestPromptDevice](./puppeteer.devicerequestpromptdevice.md) | |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Parameter
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
device
|
||||
|
||||
</td><td>
|
||||
|
||||
[DeviceRequestPromptDevice](./puppeteer.devicerequestpromptdevice.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
**Returns:**
|
||||
|
||||
Promise<void>
|
||||
|
@ -19,11 +19,44 @@ class DeviceRequestPrompt {
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | --------------------------------------------------------------------------------------------- | ------------ |
|
||||
| filter | (device: [DeviceRequestPromptDevice](./puppeteer.devicerequestpromptdevice.md)) => boolean | |
|
||||
| options | [WaitTimeoutOptions](./puppeteer.waittimeoutoptions.md) | _(Optional)_ |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Parameter
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
filter
|
||||
|
||||
</td><td>
|
||||
|
||||
(device: [DeviceRequestPromptDevice](./puppeteer.devicerequestpromptdevice.md)) => boolean
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
options
|
||||
|
||||
</td><td>
|
||||
|
||||
[WaitTimeoutOptions](./puppeteer.waittimeoutoptions.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
_(Optional)_
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
**Returns:**
|
||||
|
||||
Promise<[DeviceRequestPromptDevice](./puppeteer.devicerequestpromptdevice.md)>
|
||||
|
@ -18,7 +18,51 @@ The constructor for this class is marked as internal. Third-party code should no
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Modifiers | Type | Description |
|
||||
| -------- | --------- | ------ | -------------------------------------- |
|
||||
| id | | string | Device id during a prompt. |
|
||||
| name | | string | Device name as it appears in a prompt. |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Property
|
||||
|
||||
</th><th>
|
||||
|
||||
Modifiers
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
id
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
string
|
||||
|
||||
</td><td>
|
||||
|
||||
Device id during a prompt.
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
name
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
string
|
||||
|
||||
</td><td>
|
||||
|
||||
Device name as it appears in a prompt.
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
|
@ -16,10 +16,33 @@ class Dialog {
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| ---------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| promptText | string | _(Optional)_ optional text that will be entered in the dialog prompt. Has no effect if the dialog's type is not <code>prompt</code>. |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Parameter
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
promptText
|
||||
|
||||
</td><td>
|
||||
|
||||
string
|
||||
|
||||
</td><td>
|
||||
|
||||
_(Optional)_ optional text that will be entered in the dialog prompt. Has no effect if the dialog's type is not `prompt`.
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
**Returns:**
|
||||
|
||||
Promise<void>
|
||||
|
@ -35,10 +35,72 @@ import puppeteer from 'puppeteer';
|
||||
|
||||
## Methods
|
||||
|
||||
| Method | Modifiers | Description |
|
||||
| ---------------------------------------------------- | --------- | ----------------------------------------------------------------------------------------------- |
|
||||
| [accept(promptText)](./puppeteer.dialog.accept.md) | | A promise that resolves when the dialog has been accepted. |
|
||||
| [defaultValue()](./puppeteer.dialog.defaultvalue.md) | | The default value of the prompt, or an empty string if the dialog is not a <code>prompt</code>. |
|
||||
| [dismiss()](./puppeteer.dialog.dismiss.md) | | A promise which will resolve once the dialog has been dismissed |
|
||||
| [message()](./puppeteer.dialog.message.md) | | The message displayed in the dialog. |
|
||||
| [type()](./puppeteer.dialog.type.md) | | The type of the dialog. |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Method
|
||||
|
||||
</th><th>
|
||||
|
||||
Modifiers
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
[accept(promptText)](./puppeteer.dialog.accept.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
A promise that resolves when the dialog has been accepted.
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[defaultValue()](./puppeteer.dialog.defaultvalue.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
The default value of the prompt, or an empty string if the dialog is not a `prompt`.
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[dismiss()](./puppeteer.dialog.dismiss.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
A promise which will resolve once the dialog has been dismissed
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[message()](./puppeteer.dialog.message.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
The message displayed in the dialog.
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[type()](./puppeteer.dialog.type.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
The type of the dialog.
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
|
@ -18,10 +18,33 @@ class ElementHandle {
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | -------- | -------------------------- |
|
||||
| selector | Selector | The selector to query for. |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Parameter
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
selector
|
||||
|
||||
</td><td>
|
||||
|
||||
Selector
|
||||
|
||||
</td><td>
|
||||
|
||||
The selector to query for.
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
**Returns:**
|
||||
|
||||
Promise<[ElementHandle](./puppeteer.elementhandle.md)<[NodeFor](./puppeteer.nodefor.md)<Selector>> \| null>
|
||||
|
@ -18,10 +18,33 @@ class ElementHandle {
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | -------- | -------------------------- |
|
||||
| selector | Selector | The selector to query for. |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Parameter
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
selector
|
||||
|
||||
</td><td>
|
||||
|
||||
Selector
|
||||
|
||||
</td><td>
|
||||
|
||||
The selector to query for.
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
**Returns:**
|
||||
|
||||
Promise<Array<[ElementHandle](./puppeteer.elementhandle.md)<[NodeFor](./puppeteer.nodefor.md)<Selector>>>>
|
||||
|
@ -29,12 +29,59 @@ class ElementHandle {
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| ------------ | -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| selector | Selector | The selector to query for. |
|
||||
| pageFunction | Func \| string | The function to be evaluated in the element's page's context. An array of elements matching the given selector will be passed to the function as its first argument. |
|
||||
| args | Params | Additional arguments to pass to <code>pageFunction</code>. |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Parameter
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
selector
|
||||
|
||||
</td><td>
|
||||
|
||||
Selector
|
||||
|
||||
</td><td>
|
||||
|
||||
The selector to query for.
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
pageFunction
|
||||
|
||||
</td><td>
|
||||
|
||||
Func \| string
|
||||
|
||||
</td><td>
|
||||
|
||||
The function to be evaluated in the element's page's context. An array of elements matching the given selector will be passed to the function as its first argument.
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
args
|
||||
|
||||
</td><td>
|
||||
|
||||
Params
|
||||
|
||||
</td><td>
|
||||
|
||||
Additional arguments to pass to `pageFunction`.
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
**Returns:**
|
||||
|
||||
Promise<Awaited<ReturnType<Func>>>
|
||||
|
@ -29,12 +29,59 @@ class ElementHandle {
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| ------------ | -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| selector | Selector | The selector to query for. |
|
||||
| pageFunction | Func \| string | The function to be evaluated in this element's page's context. The first element matching the selector will be passed in as the first argument. |
|
||||
| args | Params | Additional arguments to pass to <code>pageFunction</code>. |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Parameter
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
selector
|
||||
|
||||
</td><td>
|
||||
|
||||
Selector
|
||||
|
||||
</td><td>
|
||||
|
||||
The selector to query for.
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
pageFunction
|
||||
|
||||
</td><td>
|
||||
|
||||
Func \| string
|
||||
|
||||
</td><td>
|
||||
|
||||
The function to be evaluated in this element's page's context. The first element matching the selector will be passed in as the first argument.
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
args
|
||||
|
||||
</td><td>
|
||||
|
||||
Params
|
||||
|
||||
</td><td>
|
||||
|
||||
Additional arguments to pass to `pageFunction`.
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
**Returns:**
|
||||
|
||||
Promise<Awaited<ReturnType<Func>>>
|
||||
|
@ -16,10 +16,31 @@ class ElementHandle {
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ------------------------------------------- | ----------- |
|
||||
| data | [AutofillData](./puppeteer.autofilldata.md) | |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Parameter
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
data
|
||||
|
||||
</td><td>
|
||||
|
||||
[AutofillData](./puppeteer.autofilldata.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
**Returns:**
|
||||
|
||||
Promise<void>
|
||||
|
@ -19,11 +19,44 @@ class ElementHandle {
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ------------------------------------------------------------ | ------------ |
|
||||
| this | [ElementHandle](./puppeteer.elementhandle.md)<Element> | |
|
||||
| options | Readonly<[ClickOptions](./puppeteer.clickoptions.md)> | _(Optional)_ |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Parameter
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
this
|
||||
|
||||
</td><td>
|
||||
|
||||
[ElementHandle](./puppeteer.elementhandle.md)<Element>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
options
|
||||
|
||||
</td><td>
|
||||
|
||||
Readonly<[ClickOptions](./puppeteer.clickoptions.md)>
|
||||
|
||||
</td><td>
|
||||
|
||||
_(Optional)_
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
**Returns:**
|
||||
|
||||
Promise<void>
|
||||
|
@ -16,10 +16,33 @@ class ElementHandle {
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ------------------------------- | ------------ |
|
||||
| offset | [Offset](./puppeteer.offset.md) | _(Optional)_ |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Parameter
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
offset
|
||||
|
||||
</td><td>
|
||||
|
||||
[Offset](./puppeteer.offset.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
_(Optional)_
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
**Returns:**
|
||||
|
||||
Promise<[Point](./puppeteer.point.md)>
|
||||
|
@ -16,10 +16,31 @@ class ElementHandle {
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ---------------------------------------------------------------------- | ----------- |
|
||||
| this | [ElementHandle](./puppeteer.elementhandle.md)<HTMLIFrameElement> | |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Parameter
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
this
|
||||
|
||||
</td><td>
|
||||
|
||||
[ElementHandle](./puppeteer.elementhandle.md)<HTMLIFrameElement>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
**Returns:**
|
||||
|
||||
Promise<[Frame](./puppeteer.frame.md)>
|
||||
|
@ -19,11 +19,42 @@ class ElementHandle {
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | --------------------------------------------------------------------------------------------- | ----------- |
|
||||
| this | [ElementHandle](./puppeteer.elementhandle.md)<Element> | |
|
||||
| target | [Point](./puppeteer.point.md) \| [ElementHandle](./puppeteer.elementhandle.md)<Element> | |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Parameter
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
this
|
||||
|
||||
</td><td>
|
||||
|
||||
[ElementHandle](./puppeteer.elementhandle.md)<Element>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
target
|
||||
|
||||
</td><td>
|
||||
|
||||
[Point](./puppeteer.point.md) \| [ElementHandle](./puppeteer.elementhandle.md)<Element>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
**Returns:**
|
||||
|
||||
Promise<Protocol.Input.DragData \| void>
|
||||
|
@ -24,12 +24,55 @@ class ElementHandle {
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ------------------------------------------------------------ | ------------ |
|
||||
| this | [ElementHandle](./puppeteer.elementhandle.md)<Element> | |
|
||||
| target | [ElementHandle](./puppeteer.elementhandle.md)<Node> | |
|
||||
| options | { delay: number; } | _(Optional)_ |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Parameter
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
this
|
||||
|
||||
</td><td>
|
||||
|
||||
[ElementHandle](./puppeteer.elementhandle.md)<Element>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
target
|
||||
|
||||
</td><td>
|
||||
|
||||
[ElementHandle](./puppeteer.elementhandle.md)<Node>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
options
|
||||
|
||||
</td><td>
|
||||
|
||||
{ delay: number; }
|
||||
|
||||
</td><td>
|
||||
|
||||
_(Optional)_
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
**Returns:**
|
||||
|
||||
Promise<void>
|
||||
|
@ -21,11 +21,44 @@ class ElementHandle {
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ------------------------------------------------------------ | ------------ |
|
||||
| this | [ElementHandle](./puppeteer.elementhandle.md)<Element> | |
|
||||
| data | Protocol.Input.DragData | _(Optional)_ |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Parameter
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
this
|
||||
|
||||
</td><td>
|
||||
|
||||
[ElementHandle](./puppeteer.elementhandle.md)<Element>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
data
|
||||
|
||||
</td><td>
|
||||
|
||||
Protocol.Input.DragData
|
||||
|
||||
</td><td>
|
||||
|
||||
_(Optional)_
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
**Returns:**
|
||||
|
||||
Promise<void>
|
||||
|
@ -21,11 +21,44 @@ class ElementHandle {
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ------------------------------------------------------------ | ------------ |
|
||||
| this | [ElementHandle](./puppeteer.elementhandle.md)<Element> | |
|
||||
| data | Protocol.Input.DragData | _(Optional)_ |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Parameter
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
this
|
||||
|
||||
</td><td>
|
||||
|
||||
[ElementHandle](./puppeteer.elementhandle.md)<Element>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
data
|
||||
|
||||
</td><td>
|
||||
|
||||
Protocol.Input.DragData
|
||||
|
||||
</td><td>
|
||||
|
||||
_(Optional)_
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
**Returns:**
|
||||
|
||||
Promise<void>
|
||||
|
@ -19,11 +19,42 @@ class ElementHandle {
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ------------------------------------------------------------ | ----------- |
|
||||
| this | [ElementHandle](./puppeteer.elementhandle.md)<Element> | |
|
||||
| element | [ElementHandle](./puppeteer.elementhandle.md)<Element> | |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Parameter
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
this
|
||||
|
||||
</td><td>
|
||||
|
||||
[ElementHandle](./puppeteer.elementhandle.md)<Element>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
element
|
||||
|
||||
</td><td>
|
||||
|
||||
[ElementHandle](./puppeteer.elementhandle.md)<Element>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
**Returns:**
|
||||
|
||||
Promise<void>
|
||||
|
@ -21,11 +21,44 @@ class ElementHandle {
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ------------------------------------------------------------ | ------------ |
|
||||
| this | [ElementHandle](./puppeteer.elementhandle.md)<Element> | |
|
||||
| data | Protocol.Input.DragData | _(Optional)_ |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Parameter
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
this
|
||||
|
||||
</td><td>
|
||||
|
||||
[ElementHandle](./puppeteer.elementhandle.md)<Element>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
data
|
||||
|
||||
</td><td>
|
||||
|
||||
Protocol.Input.DragData
|
||||
|
||||
</td><td>
|
||||
|
||||
_(Optional)_
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
**Returns:**
|
||||
|
||||
Promise<void>
|
||||
|
@ -16,10 +16,31 @@ class ElementHandle {
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ------------------------------------------------------------ | ----------- |
|
||||
| this | [ElementHandle](./puppeteer.elementhandle.md)<Element> | |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Parameter
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
this
|
||||
|
||||
</td><td>
|
||||
|
||||
[ElementHandle](./puppeteer.elementhandle.md)<Element>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
**Returns:**
|
||||
|
||||
Promise<void>
|
||||
|
@ -21,11 +21,44 @@ class ElementHandle {
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------- |
|
||||
| this | [ElementHandle](./puppeteer.elementhandle.md)<Element> | |
|
||||
| options | { threshold?: number; } | _(Optional)_ Threshold for the intersection between 0 (no intersection) and 1 (full intersection). Defaults to 1. |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Parameter
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
this
|
||||
|
||||
</td><td>
|
||||
|
||||
[ElementHandle](./puppeteer.elementhandle.md)<Element>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
options
|
||||
|
||||
</td><td>
|
||||
|
||||
{ threshold?: number; }
|
||||
|
||||
</td><td>
|
||||
|
||||
_(Optional)_ Threshold for the intersection between 0 (no intersection) and 1 (full intersection). Defaults to 1.
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
**Returns:**
|
||||
|
||||
Promise<boolean>
|
||||
|
@ -41,46 +41,430 @@ The constructor for this class is marked as internal. Third-party code should no
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Modifiers | Type | Description |
|
||||
| -------- | --------------------- | ----------------------------- | ------------------------------------------ |
|
||||
| frame | <code>readonly</code> | [Frame](./puppeteer.frame.md) | Frame corresponding to the current handle. |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Property
|
||||
|
||||
</th><th>
|
||||
|
||||
Modifiers
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
frame
|
||||
|
||||
</td><td>
|
||||
|
||||
`readonly`
|
||||
|
||||
</td><td>
|
||||
|
||||
[Frame](./puppeteer.frame.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
Frame corresponding to the current handle.
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
|
||||
## Methods
|
||||
|
||||
| Method | Modifiers | Description |
|
||||
| -------------------------------------------------------------------------------------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [$(selector)](./puppeteer.elementhandle._.md) | | Queries the current element for an element matching the given selector. |
|
||||
| [$$(selector)](./puppeteer.elementhandle.__.md) | | Queries the current element for all elements matching the given selector. |
|
||||
| [$$eval(selector, pageFunction, args)](./puppeteer.elementhandle.__eval.md) | | <p>Runs the given function on an array of elements matching the given selector in the current element.</p><p>If the given function returns a promise, then this method will wait till the promise resolves.</p> |
|
||||
| [$eval(selector, pageFunction, args)](./puppeteer.elementhandle._eval.md) | | <p>Runs the given function on the first element matching the given selector in the current element.</p><p>If the given function returns a promise, then this method will wait till the promise resolves.</p> |
|
||||
| [autofill(data)](./puppeteer.elementhandle.autofill.md) | | If the element is a form input, you can use [ElementHandle.autofill()](./puppeteer.elementhandle.autofill.md) to test if the form is compatible with the browser's autofill implementation. Throws an error if the form cannot be autofilled. |
|
||||
| [boundingBox()](./puppeteer.elementhandle.boundingbox.md) | | This method returns the bounding box of the element (relative to the main frame), or <code>null</code> if the element is [not part of the layout](https://drafts.csswg.org/css-display-4/#box-generation) (example: <code>display: none</code>). |
|
||||
| [boxModel()](./puppeteer.elementhandle.boxmodel.md) | | This method returns boxes of the element, or <code>null</code> if the element is [not part of the layout](https://drafts.csswg.org/css-display-4/#box-generation) (example: <code>display: none</code>). |
|
||||
| [click(this, options)](./puppeteer.elementhandle.click.md) | | This method scrolls element into view if needed, and then uses [Page.mouse](./puppeteer.page.md) to click in the center of the element. If the element is detached from DOM, the method throws an error. |
|
||||
| [clickablePoint(offset)](./puppeteer.elementhandle.clickablepoint.md) | | Returns the middle point within an element unless a specific offset is provided. |
|
||||
| [contentFrame(this)](./puppeteer.elementhandle.contentframe.md) | | Resolves the frame associated with the element, if any. Always exists for HTMLIFrameElements. |
|
||||
| [contentFrame()](./puppeteer.elementhandle.contentframe_1.md) | | |
|
||||
| [drag(this, target)](./puppeteer.elementhandle.drag.md) | | Drags an element over the given element or point. |
|
||||
| [dragAndDrop(this, target, options)](./puppeteer.elementhandle.draganddrop.md) | | |
|
||||
| [dragEnter(this, data)](./puppeteer.elementhandle.dragenter.md) | | |
|
||||
| [dragOver(this, data)](./puppeteer.elementhandle.dragover.md) | | |
|
||||
| [drop(this, element)](./puppeteer.elementhandle.drop.md) | | Drops the given element onto the current one. |
|
||||
| [drop(this, data)](./puppeteer.elementhandle.drop_1.md) | | |
|
||||
| [focus()](./puppeteer.elementhandle.focus.md) | | Calls [focus](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus) on the element. |
|
||||
| [hover(this)](./puppeteer.elementhandle.hover.md) | | This method scrolls element into view if needed, and then uses [Page](./puppeteer.page.md) to hover over the center of the element. If the element is detached from DOM, the method throws an error. |
|
||||
| [isHidden()](./puppeteer.elementhandle.ishidden.md) | | Checks if an element is hidden using the same mechanism as [ElementHandle.waitForSelector()](./puppeteer.elementhandle.waitforselector.md). |
|
||||
| [isIntersectingViewport(this, options)](./puppeteer.elementhandle.isintersectingviewport.md) | | Resolves to true if the element is visible in the current viewport. If an element is an SVG, we check if the svg owner element is in the viewport instead. See https://crbug.com/963246. |
|
||||
| [isVisible()](./puppeteer.elementhandle.isvisible.md) | | Checks if an element is visible using the same mechanism as [ElementHandle.waitForSelector()](./puppeteer.elementhandle.waitforselector.md). |
|
||||
| [press(key, options)](./puppeteer.elementhandle.press.md) | | Focuses the element, and then uses [Keyboard.down()](./puppeteer.keyboard.down.md) and [Keyboard.up()](./puppeteer.keyboard.up.md). |
|
||||
| [screenshot(options)](./puppeteer.elementhandle.screenshot.md) | | This method scrolls element into view if needed, and then uses [Page.screenshot()](./puppeteer.page.screenshot_1.md) to take a screenshot of the element. If the element is detached from DOM, the method throws an error. |
|
||||
| [screenshot(options)](./puppeteer.elementhandle.screenshot_1.md) | | |
|
||||
| [scrollIntoView(this)](./puppeteer.elementhandle.scrollintoview.md) | | Scrolls the element into view using either the automation protocol client or by calling element.scrollIntoView. |
|
||||
| [select(values)](./puppeteer.elementhandle.select.md) | | Triggers a <code>change</code> and <code>input</code> event once all the provided options have been selected. If there's no <code><select></code> element matching <code>selector</code>, the method throws an error. |
|
||||
| [tap(this)](./puppeteer.elementhandle.tap.md) | | This method scrolls element into view if needed, and then uses [Touchscreen.tap()](./puppeteer.touchscreen.tap.md) to tap in the center of the element. If the element is detached from DOM, the method throws an error. |
|
||||
| [toElement(tagName)](./puppeteer.elementhandle.toelement.md) | | Converts the current handle to the given element type. |
|
||||
| [touchEnd(this)](./puppeteer.elementhandle.touchend.md) | | |
|
||||
| [touchMove(this)](./puppeteer.elementhandle.touchmove.md) | | |
|
||||
| [touchStart(this)](./puppeteer.elementhandle.touchstart.md) | | |
|
||||
| [type(text, options)](./puppeteer.elementhandle.type.md) | | <p>Focuses the element, and then sends a <code>keydown</code>, <code>keypress</code>/<code>input</code>, and <code>keyup</code> event for each character in the text.</p><p>To press a special key, like <code>Control</code> or <code>ArrowDown</code>, use [ElementHandle.press()](./puppeteer.elementhandle.press.md).</p> |
|
||||
| [uploadFile(this, paths)](./puppeteer.elementhandle.uploadfile.md) | | Sets the value of an [input element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input) to the given file paths. |
|
||||
| [waitForSelector(selector, options)](./puppeteer.elementhandle.waitforselector.md) | | <p>Wait for an element matching the given selector to appear in the current element.</p><p>Unlike [Frame.waitForSelector()](./puppeteer.frame.waitforselector.md), this method does not work across navigations or if the element is detached from DOM.</p> |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Method
|
||||
|
||||
</th><th>
|
||||
|
||||
Modifiers
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
[$(selector)](./puppeteer.elementhandle._.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
Queries the current element for an element matching the given selector.
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[$$(selector)](./puppeteer.elementhandle.__.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
Queries the current element for all elements matching the given selector.
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[$$eval(selector, pageFunction, args)](./puppeteer.elementhandle.__eval.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
Runs the given function on an array of elements matching the given selector in the current element.
|
||||
|
||||
If the given function returns a promise, then this method will wait till the promise resolves.
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[$eval(selector, pageFunction, args)](./puppeteer.elementhandle._eval.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
Runs the given function on the first element matching the given selector in the current element.
|
||||
|
||||
If the given function returns a promise, then this method will wait till the promise resolves.
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[autofill(data)](./puppeteer.elementhandle.autofill.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
If the element is a form input, you can use [ElementHandle.autofill()](./puppeteer.elementhandle.autofill.md) to test if the form is compatible with the browser's autofill implementation. Throws an error if the form cannot be autofilled.
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[boundingBox()](./puppeteer.elementhandle.boundingbox.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
This method returns the bounding box of the element (relative to the main frame), or `null` if the element is [not part of the layout](https://drafts.csswg.org/css-display-4/#box-generation) (example: `display: none`).
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[boxModel()](./puppeteer.elementhandle.boxmodel.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
This method returns boxes of the element, or `null` if the element is [not part of the layout](https://drafts.csswg.org/css-display-4/#box-generation) (example: `display: none`).
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[click(this, options)](./puppeteer.elementhandle.click.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
This method scrolls element into view if needed, and then uses [Page.mouse](./puppeteer.page.md) to click in the center of the element. If the element is detached from DOM, the method throws an error.
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[clickablePoint(offset)](./puppeteer.elementhandle.clickablepoint.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
Returns the middle point within an element unless a specific offset is provided.
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[contentFrame(this)](./puppeteer.elementhandle.contentframe.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
Resolves the frame associated with the element, if any. Always exists for HTMLIFrameElements.
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[contentFrame()](./puppeteer.elementhandle.contentframe_1.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[drag(this, target)](./puppeteer.elementhandle.drag.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
Drags an element over the given element or point.
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[dragAndDrop(this, target, options)](./puppeteer.elementhandle.draganddrop.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[dragEnter(this, data)](./puppeteer.elementhandle.dragenter.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[dragOver(this, data)](./puppeteer.elementhandle.dragover.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[drop(this, element)](./puppeteer.elementhandle.drop.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
Drops the given element onto the current one.
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[drop(this, data)](./puppeteer.elementhandle.drop_1.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[focus()](./puppeteer.elementhandle.focus.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
Calls [focus](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus) on the element.
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[hover(this)](./puppeteer.elementhandle.hover.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
This method scrolls element into view if needed, and then uses [Page](./puppeteer.page.md) to hover over the center of the element. If the element is detached from DOM, the method throws an error.
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[isHidden()](./puppeteer.elementhandle.ishidden.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
Checks if an element is hidden using the same mechanism as [ElementHandle.waitForSelector()](./puppeteer.elementhandle.waitforselector.md).
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[isIntersectingViewport(this, options)](./puppeteer.elementhandle.isintersectingviewport.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
Resolves to true if the element is visible in the current viewport. If an element is an SVG, we check if the svg owner element is in the viewport instead. See https://crbug.com/963246.
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[isVisible()](./puppeteer.elementhandle.isvisible.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
Checks if an element is visible using the same mechanism as [ElementHandle.waitForSelector()](./puppeteer.elementhandle.waitforselector.md).
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[press(key, options)](./puppeteer.elementhandle.press.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
Focuses the element, and then uses [Keyboard.down()](./puppeteer.keyboard.down.md) and [Keyboard.up()](./puppeteer.keyboard.up.md).
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[screenshot(options)](./puppeteer.elementhandle.screenshot.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
This method scrolls element into view if needed, and then uses [Page.screenshot()](./puppeteer.page.screenshot_1.md) to take a screenshot of the element. If the element is detached from DOM, the method throws an error.
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[screenshot(options)](./puppeteer.elementhandle.screenshot_1.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[scrollIntoView(this)](./puppeteer.elementhandle.scrollintoview.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
Scrolls the element into view using either the automation protocol client or by calling element.scrollIntoView.
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[select(values)](./puppeteer.elementhandle.select.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
Triggers a `change` and `input` event once all the provided options have been selected. If there's no `<select>` element matching `selector`, the method throws an error.
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[tap(this)](./puppeteer.elementhandle.tap.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
This method scrolls element into view if needed, and then uses [Touchscreen.tap()](./puppeteer.touchscreen.tap.md) to tap in the center of the element. If the element is detached from DOM, the method throws an error.
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[toElement(tagName)](./puppeteer.elementhandle.toelement.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
Converts the current handle to the given element type.
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[touchEnd(this)](./puppeteer.elementhandle.touchend.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[touchMove(this)](./puppeteer.elementhandle.touchmove.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[touchStart(this)](./puppeteer.elementhandle.touchstart.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[type(text, options)](./puppeteer.elementhandle.type.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
Focuses the element, and then sends a `keydown`, `keypress`/`input`, and `keyup` event for each character in the text.
|
||||
|
||||
To press a special key, like `Control` or `ArrowDown`, use [ElementHandle.press()](./puppeteer.elementhandle.press.md).
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[uploadFile(this, paths)](./puppeteer.elementhandle.uploadfile.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
Sets the value of an [input element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input) to the given file paths.
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
[waitForSelector(selector, options)](./puppeteer.elementhandle.waitforselector.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
</td><td>
|
||||
|
||||
Wait for an element matching the given selector to appear in the current element.
|
||||
|
||||
Unlike [Frame.waitForSelector()](./puppeteer.frame.waitforselector.md), this method does not work across navigations or if the element is detached from DOM.
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
|
@ -16,11 +16,46 @@ class ElementHandle {
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ----------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
|
||||
| key | [KeyInput](./puppeteer.keyinput.md) | Name of key to press, such as <code>ArrowLeft</code>. See [KeyInput](./puppeteer.keyinput.md) for a list of all key names. |
|
||||
| options | Readonly<[KeyPressOptions](./puppeteer.keypressoptions.md)> | _(Optional)_ |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Parameter
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
key
|
||||
|
||||
</td><td>
|
||||
|
||||
[KeyInput](./puppeteer.keyinput.md)
|
||||
|
||||
</td><td>
|
||||
|
||||
Name of key to press, such as `ArrowLeft`. See [KeyInput](./puppeteer.keyinput.md) for a list of all key names.
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
options
|
||||
|
||||
</td><td>
|
||||
|
||||
Readonly<[KeyPressOptions](./puppeteer.keypressoptions.md)>
|
||||
|
||||
</td><td>
|
||||
|
||||
_(Optional)_
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
**Returns:**
|
||||
|
||||
Promise<void>
|
||||
|
@ -20,10 +20,31 @@ class ElementHandle {
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ------------------------------------------------------------------------------------------------------------- | ----------- |
|
||||
| options | Readonly<[ScreenshotOptions](./puppeteer.screenshotoptions.md)> & { encoding: 'base64'; } | |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Parameter
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
options
|
||||
|
||||
</td><td>
|
||||
|
||||
Readonly<[ScreenshotOptions](./puppeteer.screenshotoptions.md)> & { encoding: 'base64'; }
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
**Returns:**
|
||||
|
||||
Promise<string>
|
||||
|
@ -14,10 +14,33 @@ class ElementHandle {
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | --------------------------------------------------------------------- | ------------ |
|
||||
| options | Readonly<[ScreenshotOptions](./puppeteer.screenshotoptions.md)> | _(Optional)_ |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Parameter
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
options
|
||||
|
||||
</td><td>
|
||||
|
||||
Readonly<[ScreenshotOptions](./puppeteer.screenshotoptions.md)>
|
||||
|
||||
</td><td>
|
||||
|
||||
_(Optional)_
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
**Returns:**
|
||||
|
||||
Promise<Buffer>
|
||||
|
@ -16,10 +16,31 @@ class ElementHandle {
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ------------------------------------------------------------ | ----------- |
|
||||
| this | [ElementHandle](./puppeteer.elementhandle.md)<Element> | |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Parameter
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
this
|
||||
|
||||
</td><td>
|
||||
|
||||
[ElementHandle](./puppeteer.elementhandle.md)<Element>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
**Returns:**
|
||||
|
||||
Promise<void>
|
||||
|
@ -16,10 +16,33 @@ class ElementHandle {
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| values | string\[\] | Values of options to select. If the <code><select></code> has the <code>multiple</code> attribute, all values are considered, otherwise only the first one is taken into account. |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Parameter
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
values
|
||||
|
||||
</td><td>
|
||||
|
||||
string\[\]
|
||||
|
||||
</td><td>
|
||||
|
||||
Values of options to select. If the `<select>` has the `multiple` attribute, all values are considered, otherwise only the first one is taken into account.
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
**Returns:**
|
||||
|
||||
Promise<string\[\]>
|
||||
|
@ -16,10 +16,31 @@ class ElementHandle {
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ------------------------------------------------------------ | ----------- |
|
||||
| this | [ElementHandle](./puppeteer.elementhandle.md)<Element> | |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Parameter
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
this
|
||||
|
||||
</td><td>
|
||||
|
||||
[ElementHandle](./puppeteer.elementhandle.md)<Element>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
**Returns:**
|
||||
|
||||
Promise<void>
|
||||
|
@ -18,10 +18,33 @@ class ElementHandle {
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ---- | ----------------------------------------- |
|
||||
| tagName | K | The tag name of the desired element type. |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Parameter
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
tagName
|
||||
|
||||
</td><td>
|
||||
|
||||
K
|
||||
|
||||
</td><td>
|
||||
|
||||
The tag name of the desired element type.
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
**Returns:**
|
||||
|
||||
Promise<[HandleFor](./puppeteer.handlefor.md)<[ElementFor](./puppeteer.elementfor.md)<K>>>
|
||||
|
@ -14,10 +14,31 @@ class ElementHandle {
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ------------------------------------------------------------ | ----------- |
|
||||
| this | [ElementHandle](./puppeteer.elementhandle.md)<Element> | |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Parameter
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
this
|
||||
|
||||
</td><td>
|
||||
|
||||
[ElementHandle](./puppeteer.elementhandle.md)<Element>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
**Returns:**
|
||||
|
||||
Promise<void>
|
||||
|
@ -14,10 +14,31 @@ class ElementHandle {
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ------------------------------------------------------------ | ----------- |
|
||||
| this | [ElementHandle](./puppeteer.elementhandle.md)<Element> | |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Parameter
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
this
|
||||
|
||||
</td><td>
|
||||
|
||||
[ElementHandle](./puppeteer.elementhandle.md)<Element>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
**Returns:**
|
||||
|
||||
Promise<void>
|
||||
|
@ -14,10 +14,31 @@ class ElementHandle {
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ------------------------------------------------------------ | ----------- |
|
||||
| this | [ElementHandle](./puppeteer.elementhandle.md)<Element> | |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Parameter
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
this
|
||||
|
||||
</td><td>
|
||||
|
||||
[ElementHandle](./puppeteer.elementhandle.md)<Element>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
**Returns:**
|
||||
|
||||
Promise<void>
|
||||
|
@ -18,11 +18,44 @@ class ElementHandle {
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ------------------------------------------------------------------------- | -------------------------------------------------- |
|
||||
| text | string | |
|
||||
| options | Readonly<[KeyboardTypeOptions](./puppeteer.keyboardtypeoptions.md)> | _(Optional)_ Delay in milliseconds. Defaults to 0. |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Parameter
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
text
|
||||
|
||||
</td><td>
|
||||
|
||||
string
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
options
|
||||
|
||||
</td><td>
|
||||
|
||||
Readonly<[KeyboardTypeOptions](./puppeteer.keyboardtypeoptions.md)>
|
||||
|
||||
</td><td>
|
||||
|
||||
_(Optional)_ Delay in milliseconds. Defaults to 0.
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
**Returns:**
|
||||
|
||||
Promise<void>
|
||||
|
@ -19,11 +19,42 @@ class ElementHandle {
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | --------------------------------------------------------------------- | ----------- |
|
||||
| this | [ElementHandle](./puppeteer.elementhandle.md)<HTMLInputElement> | |
|
||||
| paths | string\[\] | |
|
||||
<table><thead><tr><th>
|
||||
|
||||
Parameter
|
||||
|
||||
</th><th>
|
||||
|
||||
Type
|
||||
|
||||
</th><th>
|
||||
|
||||
Description
|
||||
|
||||
</th></tr></thead>
|
||||
<tbody><tr><td>
|
||||
|
||||
this
|
||||
|
||||
</td><td>
|
||||
|
||||
[ElementHandle](./puppeteer.elementhandle.md)<HTMLInputElement>
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
||||
paths
|
||||
|
||||
</td><td>
|
||||
|
||||
string\[\]
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
**Returns:**
|
||||
|
||||
Promise<void>
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user