docs: remove some redundant instances of @returns (#9943)

This commit is contained in:
Nikolay Vitkov 2023-03-30 13:54:00 +02:00 committed by GitHub
parent e0eef01f1c
commit 1396274477
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
106 changed files with 364 additions and 361 deletions

View File

@ -4,6 +4,8 @@ sidebar_label: BrowserFetcher.host
# BrowserFetcher.host() method
The download host being used.
#### Signature:
```typescript
@ -15,5 +17,3 @@ class BrowserFetcher {
**Returns:**
string
The download host being used.

View File

@ -36,13 +36,13 @@ const browser = await puppeteer.launch({
## Methods
| Method | Modifiers | Description |
| ------------------------------------------------------------------------------ | --------- | --------------------------------------------------------------- |
| [canDownload(revision)](./puppeteer.browserfetcher.candownload.md) | | Initiates a HEAD request to check if the revision is available. |
| [download(revision, progressCallback)](./puppeteer.browserfetcher.download.md) | | Initiates a GET request to download the revision from the host. |
| [host()](./puppeteer.browserfetcher.host.md) | | |
| [localRevisions()](./puppeteer.browserfetcher.localrevisions.md) | | |
| [platform()](./puppeteer.browserfetcher.platform.md) | | |
| [product()](./puppeteer.browserfetcher.product.md) | | |
| [remove(revision)](./puppeteer.browserfetcher.remove.md) | | |
| [revisionInfo(revision)](./puppeteer.browserfetcher.revisioninfo.md) | | |
| Method | Modifiers | Description |
| ------------------------------------------------------------------------------ | --------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| [canDownload(revision)](./puppeteer.browserfetcher.candownload.md) | | Initiates a HEAD request to check if the revision is available. |
| [download(revision, progressCallback)](./puppeteer.browserfetcher.download.md) | | Initiates a GET request to download the revision from the host. |
| [host()](./puppeteer.browserfetcher.host.md) | | The download host being used. |
| [localRevisions()](./puppeteer.browserfetcher.localrevisions.md) | | |
| [platform()](./puppeteer.browserfetcher.platform.md) | | Returns the current <code>Platform</code>, which is one of <code>mac</code>, <code>linux</code>, <code>win32</code> or <code>win64</code>. |
| [product()](./puppeteer.browserfetcher.product.md) | | Returns the current <code>Product</code>, which is one of <code>chrome</code> or <code>firefox</code>. |
| [remove(revision)](./puppeteer.browserfetcher.remove.md) | | |
| [revisionInfo(revision)](./puppeteer.browserfetcher.revisioninfo.md) | | |

View File

@ -4,6 +4,8 @@ sidebar_label: BrowserFetcher.platform
# BrowserFetcher.platform() method
Returns the current `Platform`, which is one of `mac`, `linux`, `win32` or `win64`.
#### Signature:
```typescript
@ -15,5 +17,3 @@ class BrowserFetcher {
**Returns:**
[Platform](./puppeteer.platform.md)
Returns the current `Platform`, which is one of `mac`, `linux`, `win32` or `win64`.

View File

@ -4,6 +4,8 @@ sidebar_label: BrowserFetcher.product
# BrowserFetcher.product() method
Returns the current `Product`, which is one of `chrome` or `firefox`.
#### Signature:
```typescript
@ -15,5 +17,3 @@ class BrowserFetcher {
**Returns:**
[Product](./puppeteer.product.md)
Returns the current `Product`, which is one of `chrome` or `firefox`.

View File

@ -17,7 +17,7 @@ export interface BrowserLaunchArgumentOptions
| 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 | | |
| 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 \| 'new' | 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. | |

View File

@ -4,6 +4,8 @@ sidebar_label: ConsoleMessage.args
# ConsoleMessage.args() method
An array of arguments passed to the console.
#### Signature:
```typescript
@ -15,5 +17,3 @@ class ConsoleMessage {
**Returns:**
[JSHandle](./puppeteer.jshandle.md)\[\]
An array of arguments passed to the console.

View File

@ -4,6 +4,8 @@ sidebar_label: ConsoleMessage.location
# ConsoleMessage.location() method
The location of the console message.
#### Signature:
```typescript
@ -15,5 +17,3 @@ class ConsoleMessage {
**Returns:**
[ConsoleMessageLocation](./puppeteer.consolemessagelocation.md)
The location of the console message.

View File

@ -20,10 +20,10 @@ export declare class ConsoleMessage
## Methods
| Method | Modifiers | Description |
| -------------------------------------------------------- | --------- | ----------- |
| [args()](./puppeteer.consolemessage.args.md) | | |
| [location()](./puppeteer.consolemessage.location.md) | | |
| [stackTrace()](./puppeteer.consolemessage.stacktrace.md) | | |
| [text()](./puppeteer.consolemessage.text.md) | | |
| [type()](./puppeteer.consolemessage.type.md) | | |
| 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. |

View File

@ -4,6 +4,8 @@ sidebar_label: ConsoleMessage.stackTrace
# ConsoleMessage.stackTrace() method
The array of locations on the stack of the console message.
#### Signature:
```typescript
@ -15,5 +17,3 @@ class ConsoleMessage {
**Returns:**
[ConsoleMessageLocation](./puppeteer.consolemessagelocation.md)\[\]
The array of locations on the stack of the console message.

View File

@ -4,6 +4,8 @@ sidebar_label: ConsoleMessage.text
# ConsoleMessage.text() method
The text of the console message.
#### Signature:
```typescript
@ -15,5 +17,3 @@ class ConsoleMessage {
**Returns:**
string
The text of the console message.

View File

@ -4,6 +4,8 @@ sidebar_label: ConsoleMessage.type
# ConsoleMessage.type() method
The type of the console message.
#### Signature:
```typescript
@ -15,5 +17,3 @@ class ConsoleMessage {
**Returns:**
[ConsoleMessageType](./puppeteer.consolemessagetype.md)
The type of the console message.

View File

@ -51,9 +51,9 @@ console.log(`Bytes used: ${(usedBytes / totalBytes) * 100}%`);
## Methods
| Method | Modifiers | Description |
| --------------------------------------------------------------------- | --------- | ----------- |
| [startCSSCoverage(options)](./puppeteer.coverage.startcsscoverage.md) | | |
| [startJSCoverage(options)](./puppeteer.coverage.startjscoverage.md) | | |
| [stopCSSCoverage()](./puppeteer.coverage.stopcsscoverage.md) | | |
| [stopJSCoverage()](./puppeteer.coverage.stopjscoverage.md) | | |
| 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. |

View File

@ -4,6 +4,8 @@ sidebar_label: Coverage.stopCSSCoverage
# Coverage.stopCSSCoverage() method
Promise that resolves to the array of coverage reports for all stylesheets.
#### Signature:
```typescript
@ -16,8 +18,6 @@ class Coverage {
Promise&lt;[CoverageEntry](./puppeteer.coverageentry.md)\[\]&gt;
Promise that resolves to the array of coverage reports for all stylesheets.
## Remarks
CSS Coverage doesn't include dynamically injected style tags without sourceURLs.

View File

@ -4,6 +4,8 @@ sidebar_label: Coverage.stopJSCoverage
# Coverage.stopJSCoverage() method
Promise that resolves to the array of coverage reports for all scripts.
#### Signature:
```typescript
@ -16,8 +18,6 @@ class Coverage {
Promise&lt;[JSCoverageEntry](./puppeteer.jscoverageentry.md)\[\]&gt;
Promise that resolves to the array of coverage reports for all scripts.
## Remarks
JavaScript Coverage doesn't include anonymous scripts by default. However, scripts with sourceURLs are reported.

View File

@ -12,7 +12,7 @@ export interface CustomQueryHandler
## Properties
| Property | Modifiers | Type | Description | Default |
| -------- | --------------------- | --------------------------------------------------------- | ----------- | ------- |
| queryAll | <code>optional</code> | (node: Node, selector: string) =&gt; Iterable&lt;Node&gt; | | |
| queryOne | <code>optional</code> | (node: Node, selector: string) =&gt; Node \| null | | |
| Property | Modifiers | Type | Description | Default |
| -------- | --------------------- | --------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
| queryAll | <code>optional</code> | (node: Node, selector: string) =&gt; Iterable&lt;Node&gt; | 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) =&gt; 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). | |

View File

@ -4,6 +4,8 @@ sidebar_label: Dialog.accept
# Dialog.accept() method
A promise that resolves when the dialog has been accepted.
#### Signature:
```typescript
@ -21,5 +23,3 @@ class Dialog {
**Returns:**
Promise&lt;void&gt;
A promise that resolves when the dialog has been accepted.

View File

@ -4,6 +4,8 @@ sidebar_label: Dialog.defaultValue
# Dialog.defaultValue() method
The default value of the prompt, or an empty string if the dialog is not a `prompt`.
#### Signature:
```typescript
@ -15,5 +17,3 @@ class Dialog {
**Returns:**
string
The default value of the prompt, or an empty string if the dialog is not a `prompt`.

View File

@ -4,6 +4,8 @@ sidebar_label: Dialog.dismiss
# Dialog.dismiss() method
A promise which will resolve once the dialog has been dismissed
#### Signature:
```typescript
@ -15,5 +17,3 @@ class Dialog {
**Returns:**
Promise&lt;void&gt;
A promise which will resolve once the dialog has been dismissed

View File

@ -35,10 +35,10 @@ import puppeteer from 'puppeteer';
## Methods
| Method | Modifiers | Description |
| ---------------------------------------------------- | --------- | ----------- |
| [accept(promptText)](./puppeteer.dialog.accept.md) | | |
| [defaultValue()](./puppeteer.dialog.defaultvalue.md) | | |
| [dismiss()](./puppeteer.dialog.dismiss.md) | | |
| [message()](./puppeteer.dialog.message.md) | | |
| [type()](./puppeteer.dialog.type.md) | | |
| 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. |

View File

@ -4,6 +4,8 @@ sidebar_label: Dialog.message
# Dialog.message() method
The message displayed in the dialog.
#### Signature:
```typescript
@ -15,5 +17,3 @@ class Dialog {
**Returns:**
string
The message displayed in the dialog.

View File

@ -4,6 +4,8 @@ sidebar_label: Dialog.type
# Dialog.type() method
The type of the dialog.
#### Signature:
```typescript
@ -15,5 +17,3 @@ class Dialog {
**Returns:**
Protocol.Page.DialogType
The type of the dialog.

View File

@ -4,6 +4,8 @@ sidebar_label: Frame.childFrames
# Frame.childFrames() method
An array of child frames.
#### Signature:
```typescript
@ -15,5 +17,3 @@ class Frame {
**Returns:**
[Frame](./puppeteer.frame.md)\[\]
An array of child frames.

View File

@ -4,6 +4,8 @@ sidebar_label: Frame.content
# Frame.content() method
The full HTML contents of the frame, including the DOCTYPE.
#### Signature:
```typescript
@ -15,5 +17,3 @@ class Frame {
**Returns:**
Promise&lt;string&gt;
The full HTML contents of the frame, including the DOCTYPE.

View File

@ -4,6 +4,8 @@ sidebar_label: Frame.isDetached
# Frame.isDetached() method
Is`true` if the frame has been detached. Otherwise, `false`.
#### Signature:
```typescript
@ -15,5 +17,3 @@ class Frame {
**Returns:**
boolean
`true` if the frame has been detached. Otherwise, `false`.

View File

@ -4,6 +4,8 @@ sidebar_label: Frame.isOOPFrame
# Frame.isOOPFrame() method
Is `true` if the frame is an out-of-process (OOP) frame. Otherwise, `false`.
#### Signature:
```typescript
@ -15,5 +17,3 @@ class Frame {
**Returns:**
boolean
`true` if the frame is an out-of-process (OOP) frame. Otherwise, `false`.

View File

@ -71,25 +71,25 @@ console.log(text);
| [addScriptTag(options)](./puppeteer.frame.addscripttag.md) | | Adds a <code>&lt;script&gt;</code> tag into the page with the desired url or content. |
| [addStyleTag(options)](./puppeteer.frame.addstyletag.md) | | Adds a <code>&lt;link rel=&quot;stylesheet&quot;&gt;</code> tag into the page with the desired URL or a <code>&lt;style type=&quot;text/css&quot;&gt;</code> tag with the content. |
| [addStyleTag(options)](./puppeteer.frame.addstyletag_1.md) | | |
| [childFrames()](./puppeteer.frame.childframes.md) | | |
| [childFrames()](./puppeteer.frame.childframes.md) | | An array of child frames. |
| [click(selector, options)](./puppeteer.frame.click.md) | | Clicks the first element found that matches <code>selector</code>. |
| [content()](./puppeteer.frame.content.md) | | |
| [content()](./puppeteer.frame.content.md) | | The full HTML contents of the frame, including the DOCTYPE. |
| [evaluate(pageFunction, args)](./puppeteer.frame.evaluate.md) | | Behaves identically to [Page.evaluate()](./puppeteer.page.evaluate.md) except it's run within the the context of this frame. |
| [evaluateHandle(pageFunction, args)](./puppeteer.frame.evaluatehandle.md) | | Behaves identically to [Page.evaluateHandle()](./puppeteer.page.evaluatehandle.md) except it's run within the context of this frame. |
| [focus(selector)](./puppeteer.frame.focus.md) | | Focuses the first element that matches the <code>selector</code>. |
| [goto(url, options)](./puppeteer.frame.goto.md) | | Navigates a frame to the given url. |
| [hover(selector)](./puppeteer.frame.hover.md) | | Hovers the pointer over the center of the first element that matches the <code>selector</code>. |
| [isDetached()](./puppeteer.frame.isdetached.md) | | |
| [isOOPFrame()](./puppeteer.frame.isoopframe.md) | | |
| [name()](./puppeteer.frame.name.md) | | |
| [page()](./puppeteer.frame.page.md) | | |
| [parentFrame()](./puppeteer.frame.parentframe.md) | | |
| [isDetached()](./puppeteer.frame.isdetached.md) | | Is<code>true</code> if the frame has been detached. Otherwise, <code>false</code>. |
| [isOOPFrame()](./puppeteer.frame.isoopframe.md) | | Is <code>true</code> if the frame is an out-of-process (OOP) frame. Otherwise, <code>false</code>. |
| [name()](./puppeteer.frame.name.md) | | The frame's <code>name</code> attribute as specified in the tag. |
| [page()](./puppeteer.frame.page.md) | | The page associated with the frame. |
| [parentFrame()](./puppeteer.frame.parentframe.md) | | The parent frame, if any. Detached and main frames return <code>null</code>. |
| [select(selector, values)](./puppeteer.frame.select.md) | | Selects a set of value on the first <code>&lt;select&gt;</code> element that matches the <code>selector</code>. |
| [setContent(html, options)](./puppeteer.frame.setcontent.md) | | Set the content of the frame. |
| [tap(selector)](./puppeteer.frame.tap.md) | | Taps the first element that matches the <code>selector</code>. |
| [title()](./puppeteer.frame.title.md) | | |
| [title()](./puppeteer.frame.title.md) | | The frame's title. |
| [type(selector, text, options)](./puppeteer.frame.type.md) | | Sends a <code>keydown</code>, <code>keypress</code>/<code>input</code>, and <code>keyup</code> event for each character in the text. |
| [url()](./puppeteer.frame.url.md) | | |
| [url()](./puppeteer.frame.url.md) | | The frame's URL. |
| [waitForDevicePrompt(options)](./puppeteer.frame.waitfordeviceprompt.md) | | <p>This method is typically coupled with an action that triggers a device request from an api such as WebBluetooth.</p><p>:::caution</p><p>This must be called before the device request is made. It will not return a currently active device prompt.</p><p>:::</p> |
| [waitForFunction(pageFunction, options, args)](./puppeteer.frame.waitforfunction.md) | | |
| [waitForNavigation(options)](./puppeteer.frame.waitfornavigation.md) | | <p>Waits for the frame to navigate. It is useful for when you run code which will indirectly cause the frame to navigate.</p><p>Usage of the [History API](https://developer.mozilla.org/en-US/docs/Web/API/History_API) to change the URL is considered a navigation.</p> |

View File

@ -4,6 +4,8 @@ sidebar_label: Frame.name
# Frame.name() method
The frame's `name` attribute as specified in the tag.
#### Signature:
```typescript
@ -16,8 +18,6 @@ class Frame {
string
The frame's `name` attribute as specified in the tag.
## Remarks
This value is calculated once when the frame is created, and will not update if the attribute is changed later.

View File

@ -4,6 +4,8 @@ sidebar_label: Frame.page
# Frame.page() method
The page associated with the frame.
#### Signature:
```typescript
@ -15,5 +17,3 @@ class Frame {
**Returns:**
[Page](./puppeteer.page.md)
The page associated with the frame.

View File

@ -4,6 +4,8 @@ sidebar_label: Frame.parentFrame
# Frame.parentFrame() method
The parent frame, if any. Detached and main frames return `null`.
#### Signature:
```typescript
@ -15,5 +17,3 @@ class Frame {
**Returns:**
[Frame](./puppeteer.frame.md) \| null
The parent frame, if any. Detached and main frames return `null`.

View File

@ -4,6 +4,8 @@ sidebar_label: Frame.title
# Frame.title() method
The frame's title.
#### Signature:
```typescript
@ -15,5 +17,3 @@ class Frame {
**Returns:**
Promise&lt;string&gt;
the frame's title.

View File

@ -4,6 +4,8 @@ sidebar_label: Frame.url
# Frame.url() method
The frame's URL.
#### Signature:
```typescript
@ -15,5 +17,3 @@ class Frame {
**Returns:**
string
The frame's URL.

View File

@ -4,6 +4,8 @@ sidebar_label: HTTPRequest.abortErrorReason
# HTTPRequest.abortErrorReason() method
The most recent reason for aborting the request
#### Signature:
```typescript
@ -15,5 +17,3 @@ class HTTPRequest {
**Returns:**
Protocol.Network.ErrorReason \| null
the most recent reason for aborting the request

View File

@ -4,6 +4,8 @@ sidebar_label: HTTPRequest.continueRequestOverrides
# HTTPRequest.continueRequestOverrides() method
The `ContinueRequestOverrides` that will be used if the interception is allowed to continue (ie, `abort()` and `respond()` aren't called).
#### Signature:
```typescript
@ -15,5 +17,3 @@ class HTTPRequest {
**Returns:**
[ContinueRequestOverrides](./puppeteer.continuerequestoverrides.md)
the `ContinueRequestOverrides` that will be used if the interception is allowed to continue (ie, `abort()` and `respond()` aren't called).

View File

@ -4,6 +4,8 @@ sidebar_label: HTTPRequest.frame
# HTTPRequest.frame() method
The frame that initiated the request, or null if navigating to error pages.
#### Signature:
```typescript
@ -15,5 +17,3 @@ class HTTPRequest {
**Returns:**
[Frame](./puppeteer.frame.md) \| null
the frame that initiated the request, or null if navigating to error pages.

View File

@ -4,6 +4,8 @@ sidebar_label: HTTPRequest.headers
# HTTPRequest.headers() method
An object with HTTP headers associated with the request. All header names are lower-case.
#### Signature:
```typescript
@ -15,5 +17,3 @@ class HTTPRequest {
**Returns:**
Record&lt;string, string&gt;
an object with HTTP headers associated with the request. All header names are lower-case.

View File

@ -4,6 +4,8 @@ sidebar_label: HTTPRequest.initiator
# HTTPRequest.initiator() method
The initiator of the request.
#### Signature:
```typescript
@ -15,5 +17,3 @@ class HTTPRequest {
**Returns:**
Protocol.Network.Initiator
the initiator of the request.

View File

@ -4,6 +4,12 @@ sidebar_label: HTTPRequest.interceptResolutionState
# HTTPRequest.interceptResolutionState() method
An InterceptResolutionState object describing the current resolution action and priority.
InterceptResolutionState contains: action: InterceptResolutionAction priority?: number
InterceptResolutionAction is one of: `abort`, `respond`, `continue`, `disabled`, `none`, or `already-handled`.
#### Signature:
```typescript
@ -15,9 +21,3 @@ class HTTPRequest {
**Returns:**
[InterceptResolutionState](./puppeteer.interceptresolutionstate.md)
An InterceptResolutionState object describing the current resolution action and priority.
InterceptResolutionState contains: action: InterceptResolutionAction priority?: number
InterceptResolutionAction is one of: `abort`, `respond`, `continue`, `disabled`, `none`, or `already-handled`.

View File

@ -4,6 +4,8 @@ sidebar_label: HTTPRequest.isInterceptResolutionHandled
# HTTPRequest.isInterceptResolutionHandled() method
Is `true` if the intercept resolution has already been handled, `false` otherwise.
#### Signature:
```typescript
@ -15,5 +17,3 @@ class HTTPRequest {
**Returns:**
boolean
`true` if the intercept resolution has already been handled, `false` otherwise.

View File

@ -4,6 +4,8 @@ sidebar_label: HTTPRequest.isNavigationRequest
# HTTPRequest.isNavigationRequest() method
True if the request is the driver of the current frame's navigation.
#### Signature:
```typescript
@ -15,5 +17,3 @@ class HTTPRequest {
**Returns:**
boolean
true if the request is the driver of the current frame's navigation.

View File

@ -40,26 +40,26 @@ The constructor for this class is marked as internal. Third-party code should no
## Methods
| Method | Modifiers | Description |
| ------------------------------------------------------------------------------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [abort(errorCode, priority)](./puppeteer.httprequest.abort.md) | | Aborts a request. |
| [abortErrorReason()](./puppeteer.httprequest.aborterrorreason.md) | | |
| [continue(overrides, priority)](./puppeteer.httprequest.continue.md) | | Continues request with optional request overrides. |
| [continueRequestOverrides()](./puppeteer.httprequest.continuerequestoverrides.md) | | |
| [enqueueInterceptAction(pendingHandler)](./puppeteer.httprequest.enqueueinterceptaction.md) | | Adds an async request handler to the processing queue. Deferred handlers are not guaranteed to execute in any particular order, but they are guaranteed to resolve before the request interception is finalized. |
| [failure()](./puppeteer.httprequest.failure.md) | | Access information about the request's failure. |
| [finalizeInterceptions()](./puppeteer.httprequest.finalizeinterceptions.md) | | Awaits pending interception handlers and then decides how to fulfill the request interception. |
| [frame()](./puppeteer.httprequest.frame.md) | | |
| [headers()](./puppeteer.httprequest.headers.md) | | |
| [initiator()](./puppeteer.httprequest.initiator.md) | | |
| [interceptResolutionState()](./puppeteer.httprequest.interceptresolutionstate.md) | | |
| [isInterceptResolutionHandled()](./puppeteer.httprequest.isinterceptresolutionhandled.md) | | |
| [isNavigationRequest()](./puppeteer.httprequest.isnavigationrequest.md) | | |
| [method()](./puppeteer.httprequest.method.md) | | |
| [postData()](./puppeteer.httprequest.postdata.md) | | |
| [redirectChain()](./puppeteer.httprequest.redirectchain.md) | | A <code>redirectChain</code> is a chain of requests initiated to fetch a resource. |
| [resourceType()](./puppeteer.httprequest.resourcetype.md) | | Contains the request's resource type as it was perceived by the rendering engine. |
| [respond(response, priority)](./puppeteer.httprequest.respond.md) | | Fulfills a request with the given response. |
| [response()](./puppeteer.httprequest.response.md) | | |
| [responseForRequest()](./puppeteer.httprequest.responseforrequest.md) | | |
| [url()](./puppeteer.httprequest.url.md) | | |
| Method | Modifiers | Description |
| ------------------------------------------------------------------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [abort(errorCode, priority)](./puppeteer.httprequest.abort.md) | | Aborts a request. |
| [abortErrorReason()](./puppeteer.httprequest.aborterrorreason.md) | | The most recent reason for aborting the request |
| [continue(overrides, priority)](./puppeteer.httprequest.continue.md) | | Continues request with optional request overrides. |
| [continueRequestOverrides()](./puppeteer.httprequest.continuerequestoverrides.md) | | The <code>ContinueRequestOverrides</code> that will be used if the interception is allowed to continue (ie, <code>abort()</code> and <code>respond()</code> aren't called). |
| [enqueueInterceptAction(pendingHandler)](./puppeteer.httprequest.enqueueinterceptaction.md) | | Adds an async request handler to the processing queue. Deferred handlers are not guaranteed to execute in any particular order, but they are guaranteed to resolve before the request interception is finalized. |
| [failure()](./puppeteer.httprequest.failure.md) | | Access information about the request's failure. |
| [finalizeInterceptions()](./puppeteer.httprequest.finalizeinterceptions.md) | | Awaits pending interception handlers and then decides how to fulfill the request interception. |
| [frame()](./puppeteer.httprequest.frame.md) | | The frame that initiated the request, or null if navigating to error pages. |
| [headers()](./puppeteer.httprequest.headers.md) | | An object with HTTP headers associated with the request. All header names are lower-case. |
| [initiator()](./puppeteer.httprequest.initiator.md) | | The initiator of the request. |
| [interceptResolutionState()](./puppeteer.httprequest.interceptresolutionstate.md) | | <p>An InterceptResolutionState object describing the current resolution action and priority.</p><p>InterceptResolutionState contains: action: InterceptResolutionAction priority?: number</p><p>InterceptResolutionAction is one of: <code>abort</code>, <code>respond</code>, <code>continue</code>, <code>disabled</code>, <code>none</code>, or <code>already-handled</code>.</p> |
| [isInterceptResolutionHandled()](./puppeteer.httprequest.isinterceptresolutionhandled.md) | | Is <code>true</code> if the intercept resolution has already been handled, <code>false</code> otherwise. |
| [isNavigationRequest()](./puppeteer.httprequest.isnavigationrequest.md) | | True if the request is the driver of the current frame's navigation. |
| [method()](./puppeteer.httprequest.method.md) | | The method used (<code>GET</code>, <code>POST</code>, etc.) |
| [postData()](./puppeteer.httprequest.postdata.md) | | The request's post body, if any. |
| [redirectChain()](./puppeteer.httprequest.redirectchain.md) | | A <code>redirectChain</code> is a chain of requests initiated to fetch a resource. |
| [resourceType()](./puppeteer.httprequest.resourcetype.md) | | Contains the request's resource type as it was perceived by the rendering engine. |
| [respond(response, priority)](./puppeteer.httprequest.respond.md) | | Fulfills a request with the given response. |
| [response()](./puppeteer.httprequest.response.md) | | A matching <code>HTTPResponse</code> object, or null if the response has not been received yet. |
| [responseForRequest()](./puppeteer.httprequest.responseforrequest.md) | | The <code>ResponseForRequest</code> that gets used if the interception is allowed to respond (ie, <code>abort()</code> is not called). |
| [url()](./puppeteer.httprequest.url.md) | | The URL of the request |

View File

@ -4,6 +4,8 @@ sidebar_label: HTTPRequest.method
# HTTPRequest.method() method
The method used (`GET`, `POST`, etc.)
#### Signature:
```typescript
@ -15,5 +17,3 @@ class HTTPRequest {
**Returns:**
string
the method used (`GET`, `POST`, etc.)

View File

@ -4,6 +4,8 @@ sidebar_label: HTTPRequest.postData
# HTTPRequest.postData() method
The request's post body, if any.
#### Signature:
```typescript
@ -15,5 +17,3 @@ class HTTPRequest {
**Returns:**
string \| undefined
the request's post body, if any.

View File

@ -4,6 +4,8 @@ sidebar_label: HTTPRequest.response
# HTTPRequest.response() method
A matching `HTTPResponse` object, or null if the response has not been received yet.
#### Signature:
```typescript
@ -15,5 +17,3 @@ class HTTPRequest {
**Returns:**
[HTTPResponse](./puppeteer.httpresponse.md) \| null
A matching `HTTPResponse` object, or null if the response has not been received yet.

View File

@ -4,6 +4,8 @@ sidebar_label: HTTPRequest.responseForRequest
# HTTPRequest.responseForRequest() method
The `ResponseForRequest` that gets used if the interception is allowed to respond (ie, `abort()` is not called).
#### Signature:
```typescript
@ -15,5 +17,3 @@ class HTTPRequest {
**Returns:**
Partial&lt;[ResponseForRequest](./puppeteer.responseforrequest.md)&gt; \| null
The `ResponseForRequest` that gets used if the interception is allowed to respond (ie, `abort()` is not called).

View File

@ -4,6 +4,8 @@ sidebar_label: HTTPRequest.url
# HTTPRequest.url() method
The URL of the request
#### Signature:
```typescript
@ -15,5 +17,3 @@ class HTTPRequest {
**Returns:**
string
the URL of the request

View File

@ -4,6 +4,8 @@ sidebar_label: HTTPResponse.buffer
# HTTPResponse.buffer() method
Promise which resolves to a buffer with response body.
#### Signature:
```typescript
@ -15,5 +17,3 @@ class HTTPResponse {
**Returns:**
Promise&lt;Buffer&gt;
Promise which resolves to a buffer with response body.

View File

@ -4,6 +4,8 @@ sidebar_label: HTTPResponse.frame
# HTTPResponse.frame() method
A [Frame](./puppeteer.frame.md) that initiated this response, or `null` if navigating to error pages.
#### Signature:
```typescript
@ -15,5 +17,3 @@ class HTTPResponse {
**Returns:**
[Frame](./puppeteer.frame.md) \| null
A [Frame](./puppeteer.frame.md) that initiated this response, or `null` if navigating to error pages.

View File

@ -4,6 +4,8 @@ sidebar_label: HTTPResponse.fromCache
# HTTPResponse.fromCache() method
True if the response was served from either the browser's disk cache or memory cache.
#### Signature:
```typescript
@ -15,5 +17,3 @@ class HTTPResponse {
**Returns:**
boolean
True if the response was served from either the browser's disk cache or memory cache.

View File

@ -4,6 +4,8 @@ sidebar_label: HTTPResponse.fromServiceWorker
# HTTPResponse.fromServiceWorker() method
True if the response was served by a service worker.
#### Signature:
```typescript
@ -15,5 +17,3 @@ class HTTPResponse {
**Returns:**
boolean
True if the response was served by a service worker.

View File

@ -4,6 +4,8 @@ sidebar_label: HTTPResponse.headers
# HTTPResponse.headers() method
An object with HTTP headers associated with the response. All header names are lower-case.
#### Signature:
```typescript
@ -15,5 +17,3 @@ class HTTPResponse {
**Returns:**
Record&lt;string, string&gt;
An object with HTTP headers associated with the response. All header names are lower-case.

View File

@ -4,6 +4,8 @@ sidebar_label: HTTPResponse.json
# HTTPResponse.json() method
Promise which resolves to a JSON representation of response body.
#### Signature:
```typescript
@ -16,8 +18,6 @@ class HTTPResponse {
Promise&lt;any&gt;
Promise which resolves to a JSON representation of response body.
## Remarks
This method will throw if the response body is not parsable via `JSON.parse`.

View File

@ -18,20 +18,20 @@ The constructor for this class is marked as internal. Third-party code should no
## Methods
| Method | Modifiers | Description |
| -------------------------------------------------------------------- | --------- | ----------- |
| [buffer()](./puppeteer.httpresponse.buffer.md) | | |
| [frame()](./puppeteer.httpresponse.frame.md) | | |
| [fromCache()](./puppeteer.httpresponse.fromcache.md) | | |
| [fromServiceWorker()](./puppeteer.httpresponse.fromserviceworker.md) | | |
| [headers()](./puppeteer.httpresponse.headers.md) | | |
| [json()](./puppeteer.httpresponse.json.md) | | |
| [ok()](./puppeteer.httpresponse.ok.md) | | |
| [remoteAddress()](./puppeteer.httpresponse.remoteaddress.md) | | |
| [request()](./puppeteer.httpresponse.request.md) | | |
| [securityDetails()](./puppeteer.httpresponse.securitydetails.md) | | |
| [status()](./puppeteer.httpresponse.status.md) | | |
| [statusText()](./puppeteer.httpresponse.statustext.md) | | |
| [text()](./puppeteer.httpresponse.text.md) | | |
| [timing()](./puppeteer.httpresponse.timing.md) | | |
| [url()](./puppeteer.httpresponse.url.md) | | |
| Method | Modifiers | Description |
| -------------------------------------------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| [buffer()](./puppeteer.httpresponse.buffer.md) | | Promise which resolves to a buffer with response body. |
| [frame()](./puppeteer.httpresponse.frame.md) | | A [Frame](./puppeteer.frame.md) that initiated this response, or <code>null</code> if navigating to error pages. |
| [fromCache()](./puppeteer.httpresponse.fromcache.md) | | True if the response was served from either the browser's disk cache or memory cache. |
| [fromServiceWorker()](./puppeteer.httpresponse.fromserviceworker.md) | | True if the response was served by a service worker. |
| [headers()](./puppeteer.httpresponse.headers.md) | | An object with HTTP headers associated with the response. All header names are lower-case. |
| [json()](./puppeteer.httpresponse.json.md) | | Promise which resolves to a JSON representation of response body. |
| [ok()](./puppeteer.httpresponse.ok.md) | | True if the response was successful (status in the range 200-299). |
| [remoteAddress()](./puppeteer.httpresponse.remoteaddress.md) | | The IP address and port number used to connect to the remote server. |
| [request()](./puppeteer.httpresponse.request.md) | | A matching [HTTPRequest](./puppeteer.httprequest.md) object. |
| [securityDetails()](./puppeteer.httpresponse.securitydetails.md) | | [SecurityDetails](./puppeteer.securitydetails.md) if the response was received over the secure connection, or <code>null</code> otherwise. |
| [status()](./puppeteer.httpresponse.status.md) | | The status code of the response (e.g., 200 for a success). |
| [statusText()](./puppeteer.httpresponse.statustext.md) | | The status text of the response (e.g. usually an "OK" for a success). |
| [text()](./puppeteer.httpresponse.text.md) | | Promise which resolves to a text representation of response body. |
| [timing()](./puppeteer.httpresponse.timing.md) | | Timing information related to the response. |
| [url()](./puppeteer.httpresponse.url.md) | | The URL of the response. |

View File

@ -4,6 +4,8 @@ sidebar_label: HTTPResponse.ok
# HTTPResponse.ok() method
True if the response was successful (status in the range 200-299).
#### Signature:
```typescript
@ -15,5 +17,3 @@ class HTTPResponse {
**Returns:**
boolean
True if the response was successful (status in the range 200-299).

View File

@ -4,6 +4,8 @@ sidebar_label: HTTPResponse.remoteAddress
# HTTPResponse.remoteAddress() method
The IP address and port number used to connect to the remote server.
#### Signature:
```typescript
@ -15,5 +17,3 @@ class HTTPResponse {
**Returns:**
[RemoteAddress](./puppeteer.remoteaddress.md)
The IP address and port number used to connect to the remote server.

View File

@ -4,6 +4,8 @@ sidebar_label: HTTPResponse.request
# HTTPResponse.request() method
A matching [HTTPRequest](./puppeteer.httprequest.md) object.
#### Signature:
```typescript
@ -15,5 +17,3 @@ class HTTPResponse {
**Returns:**
[HTTPRequest](./puppeteer.httprequest.md)
A matching [HTTPRequest](./puppeteer.httprequest.md) object.

View File

@ -4,6 +4,8 @@ sidebar_label: HTTPResponse.securityDetails
# HTTPResponse.securityDetails() method
[SecurityDetails](./puppeteer.securitydetails.md) if the response was received over the secure connection, or `null` otherwise.
#### Signature:
```typescript
@ -15,5 +17,3 @@ class HTTPResponse {
**Returns:**
[SecurityDetails](./puppeteer.securitydetails.md) \| null
[SecurityDetails](./puppeteer.securitydetails.md) if the response was received over the secure connection, or `null` otherwise.

View File

@ -4,6 +4,8 @@ sidebar_label: HTTPResponse.status
# HTTPResponse.status() method
The status code of the response (e.g., 200 for a success).
#### Signature:
```typescript
@ -15,5 +17,3 @@ class HTTPResponse {
**Returns:**
number
The status code of the response (e.g., 200 for a success).

View File

@ -4,6 +4,8 @@ sidebar_label: HTTPResponse.statusText
# HTTPResponse.statusText() method
The status text of the response (e.g. usually an "OK" for a success).
#### Signature:
```typescript
@ -15,5 +17,3 @@ class HTTPResponse {
**Returns:**
string
The status text of the response (e.g. usually an "OK" for a success).

View File

@ -4,6 +4,8 @@ sidebar_label: HTTPResponse.text
# HTTPResponse.text() method
Promise which resolves to a text representation of response body.
#### Signature:
```typescript
@ -15,5 +17,3 @@ class HTTPResponse {
**Returns:**
Promise&lt;string&gt;
Promise which resolves to a text representation of response body.

View File

@ -4,6 +4,8 @@ sidebar_label: HTTPResponse.timing
# HTTPResponse.timing() method
Timing information related to the response.
#### Signature:
```typescript
@ -15,5 +17,3 @@ class HTTPResponse {
**Returns:**
Protocol.Network.ResourceTiming \| null
Timing information related to the response.

View File

@ -4,6 +4,8 @@ sidebar_label: HTTPResponse.url
# HTTPResponse.url() method
The URL of the response.
#### Signature:
```typescript
@ -15,5 +17,3 @@ class HTTPResponse {
**Returns:**
string
The URL of the response.

View File

@ -4,6 +4,8 @@ sidebar_label: JSHandle.asElement
# JSHandle.asElement() method
Either `null` or the handle itself if the handle is an instance of [ElementHandle](./puppeteer.elementhandle.md).
#### Signature:
```typescript
@ -15,5 +17,3 @@ class JSHandle {
**Returns:**
[ElementHandle](./puppeteer.elementhandle.md)&lt;Node&gt; \| null
Either `null` or the handle itself if the handle is an instance of [ElementHandle](./puppeteer.elementhandle.md).

View File

@ -4,6 +4,8 @@ sidebar_label: JSHandle.jsonValue
# JSHandle.jsonValue() method
A vanilla object representing the serializable portions of the referenced object.
#### Signature:
```typescript
@ -16,8 +18,6 @@ class JSHandle {
Promise&lt;T&gt;
A vanilla object representing the serializable portions of the referenced object.
## Exceptions
Throws if the object cannot be serialized due to circularity.

View File

@ -36,7 +36,7 @@ const windowHandle = await page.evaluateHandle(() => window);
| Method | Modifiers | Description |
| ---------------------------------------------------------------------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [asElement()](./puppeteer.jshandle.aselement.md) | | |
| [asElement()](./puppeteer.jshandle.aselement.md) | | Either <code>null</code> or the handle itself if the handle is an instance of [ElementHandle](./puppeteer.elementhandle.md). |
| [dispose()](./puppeteer.jshandle.dispose.md) | | Releases the object referenced by the handle for garbage collection. |
| [evaluate(pageFunction, args)](./puppeteer.jshandle.evaluate.md) | | Evaluates the given function with the current handle as its first argument. |
| [evaluateHandle(pageFunction, args)](./puppeteer.jshandle.evaluatehandle.md) | | Evaluates the given function with the current handle as its first argument. |
@ -44,6 +44,6 @@ const windowHandle = await page.evaluateHandle(() => window);
| [getProperty(propertyName)](./puppeteer.jshandle.getproperty.md) | | Fetches a single property from the referenced object. |
| [getProperty(propertyName)](./puppeteer.jshandle.getproperty_1.md) | | |
| [getProperty(propertyName)](./puppeteer.jshandle.getproperty_2.md) | | |
| [jsonValue()](./puppeteer.jshandle.jsonvalue.md) | | |
| [jsonValue()](./puppeteer.jshandle.jsonvalue.md) | | A vanilla object representing the serializable portions of the referenced object. |
| [remoteObject()](./puppeteer.jshandle.remoteobject.md) | | Provides access to the \[Protocol.Runtime.RemoteObject\](https://chromedevtools.github.io/devtools-protocol/tot/Runtime/\#type-RemoteObject) backing this handle. |
| [toString()](./puppeteer.jshandle.tostring.md) | | Returns a string representation of the JSHandle. |

View File

@ -4,6 +4,8 @@ sidebar_label: Page.content
# Page.content() method
The full HTML contents of the page, including the DOCTYPE.
#### Signature:
```typescript

View File

@ -4,6 +4,8 @@ sidebar_label: Page.frames
# Page.frames() method
An array of all frames attached to the page.
#### Signature:
```typescript
@ -15,5 +17,3 @@ class Page {
**Returns:**
[Frame](./puppeteer.frame.md)\[\]
An array of all frames attached to the page.

View File

@ -4,6 +4,8 @@ sidebar_label: Page.getDefaultTimeout
# Page.getDefaultTimeout() method
Maximum time in milliseconds.
#### Signature:
```typescript
@ -15,5 +17,3 @@ class Page {
**Returns:**
number
Maximum time in milliseconds.

View File

@ -4,6 +4,8 @@ sidebar_label: Page.isDragInterceptionEnabled
# Page.isDragInterceptionEnabled() method
`true` if drag events are being intercepted, `false` otherwise.
#### Signature:
```typescript
@ -15,5 +17,3 @@ class Page {
**Returns:**
boolean
`true` if drag events are being intercepted, `false` otherwise.

View File

@ -4,6 +4,8 @@ sidebar_label: Page.isJavaScriptEnabled
# Page.isJavaScriptEnabled() method
`true` if the page has JavaScript enabled, `false` otherwise.
#### Signature:
```typescript
@ -15,5 +17,3 @@ class Page {
**Returns:**
boolean
`true` if the page has JavaScript enabled, `false` otherwise.

View File

@ -4,6 +4,8 @@ sidebar_label: Page.mainFrame
# Page.mainFrame() method
The page's main frame.
#### Signature:
```typescript
@ -16,8 +18,6 @@ class Page {
[Frame](./puppeteer.frame.md)
The page's main frame.
## Remarks
Page is guaranteed to have a main frame which persists during navigations.

View File

@ -91,7 +91,7 @@ page.off('request', logRequest);
| [browserContext()](./puppeteer.page.browsercontext.md) | | Get the browser context that the page belongs to. |
| [click(selector, options)](./puppeteer.page.click.md) | | This method fetches an element with <code>selector</code>, scrolls it into view if needed, and then uses [Page.mouse](./puppeteer.page.md) to click in the center of the element. If there's no element matching <code>selector</code>, the method throws an error. |
| [close(options)](./puppeteer.page.close.md) | | |
| [content()](./puppeteer.page.content.md) | | |
| [content()](./puppeteer.page.content.md) | | The full HTML contents of the page, including the DOCTYPE. |
| [cookies(urls)](./puppeteer.page.cookies.md) | | If no URLs are specified, this method returns cookies for the current page URL. If URLs are specified, only cookies for those URLs are returned. |
| [createPDFStream(options)](./puppeteer.page.createpdfstream.md) | | Generates a PDF of the page with the <code>print</code> CSS media type. |
| [deleteCookie(cookies)](./puppeteer.page.deletecookie.md) | | |
@ -108,30 +108,30 @@ page.off('request', logRequest);
| [evaluateOnNewDocument(pageFunction, args)](./puppeteer.page.evaluateonnewdocument.md) | | <p>Adds a function which would be invoked in one of the following scenarios:</p><p>- whenever the page is navigated</p><p>- whenever the child frame is attached or navigated. In this case, the function is invoked in the context of the newly attached frame.</p><p>The function is invoked after the document was created but before any of its scripts were run. This is useful to amend the JavaScript environment, e.g. to seed <code>Math.random</code>.</p> |
| [exposeFunction(name, pptrFunction)](./puppeteer.page.exposefunction.md) | | <p>The method adds a function called <code>name</code> on the page's <code>window</code> object. When called, the function executes <code>puppeteerFunction</code> in node.js and returns a <code>Promise</code> which resolves to the return value of <code>puppeteerFunction</code>.</p><p>If the puppeteerFunction returns a <code>Promise</code>, it will be awaited.</p><p>:::note</p><p>Functions installed via <code>page.exposeFunction</code> survive navigations.</p><p>:::note</p> |
| [focus(selector)](./puppeteer.page.focus.md) | | This method fetches an element with <code>selector</code> and focuses it. If there's no element matching <code>selector</code>, the method throws an error. |
| [frames()](./puppeteer.page.frames.md) | | |
| [getDefaultTimeout()](./puppeteer.page.getdefaulttimeout.md) | | |
| [frames()](./puppeteer.page.frames.md) | | An array of all frames attached to the page. |
| [getDefaultTimeout()](./puppeteer.page.getdefaulttimeout.md) | | Maximum time in milliseconds. |
| [goBack(options)](./puppeteer.page.goback.md) | | This method navigate to the previous page in history. |
| [goForward(options)](./puppeteer.page.goforward.md) | | This method navigate to the next page in history. |
| [goto(url, options)](./puppeteer.page.goto.md) | | |
| [hover(selector)](./puppeteer.page.hover.md) | | This method fetches an element with <code>selector</code>, scrolls it into view if needed, and then uses [Page.mouse](./puppeteer.page.md) to hover over the center of the element. If there's no element matching <code>selector</code>, the method throws an error. |
| [isClosed()](./puppeteer.page.isclosed.md) | | Indicates that the page has been closed. |
| [isDragInterceptionEnabled()](./puppeteer.page.isdraginterceptionenabled.md) | | |
| [isJavaScriptEnabled()](./puppeteer.page.isjavascriptenabled.md) | | |
| [mainFrame()](./puppeteer.page.mainframe.md) | | |
| [metrics()](./puppeteer.page.metrics.md) | | |
| [isDragInterceptionEnabled()](./puppeteer.page.isdraginterceptionenabled.md) | | <code>true</code> if drag events are being intercepted, <code>false</code> otherwise. |
| [isJavaScriptEnabled()](./puppeteer.page.isjavascriptenabled.md) | | <code>true</code> if the page has JavaScript enabled, <code>false</code> otherwise. |
| [mainFrame()](./puppeteer.page.mainframe.md) | | The page's main frame. |
| [metrics()](./puppeteer.page.metrics.md) | | Object containing metrics as key/value pairs. |
| [off(eventName, handler)](./puppeteer.page.off.md) | | |
| [on(eventName, handler)](./puppeteer.page.on.md) | | <p>Listen to page events.</p><p>:::note</p><p>This method exists to define event typings and handle proper wireup of cooperative request interception. Actual event listening and dispatching is delegated to [EventEmitter](./puppeteer.eventemitter.md).</p><p>:::</p> |
| [once(eventName, handler)](./puppeteer.page.once.md) | | |
| [pdf(options)](./puppeteer.page.pdf.md) | | Generates a PDF of the page with the <code>print</code> CSS media type. |
| [queryObjects(prototypeHandle)](./puppeteer.page.queryobjects.md) | | This method iterates the JavaScript heap and finds all objects with the given prototype. |
| [reload(options)](./puppeteer.page.reload.md) | | |
| [screenshot(options)](./puppeteer.page.screenshot.md) | | |
| [screenshot(options)](./puppeteer.page.screenshot.md) | | Captures screenshot of the current page. |
| [screenshot(options)](./puppeteer.page.screenshot_1.md) | | |
| [screenshot(options)](./puppeteer.page.screenshot_2.md) | | |
| [select(selector, values)](./puppeteer.page.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>&lt;select&gt;</code> element matching <code>selector</code>, the method throws an error. |
| [setBypassCSP(enabled)](./puppeteer.page.setbypasscsp.md) | | Toggles bypassing page's Content-Security-Policy. |
| [setCacheEnabled(enabled)](./puppeteer.page.setcacheenabled.md) | | Toggles ignoring cache for each request based on the enabled state. By default, caching is enabled. |
| [setContent(html, options)](./puppeteer.page.setcontent.md) | | |
| [setContent(html, options)](./puppeteer.page.setcontent.md) | | Set the content of the page. |
| [setCookie(cookies)](./puppeteer.page.setcookie.md) | | |
| [setDefaultNavigationTimeout(timeout)](./puppeteer.page.setdefaultnavigationtimeout.md) | | <p>This setting will change the default maximum navigation time for the following methods and related shortcuts:</p><p>- [page.goBack(options)](./puppeteer.page.goback.md)</p><p>- [page.goForward(options)](./puppeteer.page.goforward.md)</p><p>- [page.goto(url,options)](./puppeteer.page.goto.md)</p><p>- [page.reload(options)](./puppeteer.page.reload.md)</p><p>- [page.setContent(html,options)](./puppeteer.page.setcontent.md)</p><p>- [page.waitForNavigation(options)](./puppeteer.page.waitfornavigation.md)</p> |
| [setDefaultTimeout(timeout)](./puppeteer.page.setdefaulttimeout.md) | | |
@ -144,11 +144,11 @@ page.off('request', logRequest);
| [setUserAgent(userAgent, userAgentMetadata)](./puppeteer.page.setuseragent.md) | | |
| [setViewport(viewport)](./puppeteer.page.setviewport.md) | | <p><code>page.setViewport</code> will resize the page. A lot of websites don't expect phones to change size, so you should set the viewport before navigating to the page.</p><p>In the case of multiple pages in a single browser, each page can have its own viewport size.</p> |
| [tap(selector)](./puppeteer.page.tap.md) | | This method fetches an element with <code>selector</code>, scrolls it into view if needed, and then uses [Page.touchscreen](./puppeteer.page.md) to tap in the center of the element. If there's no element matching <code>selector</code>, the method throws an error. |
| [target()](./puppeteer.page.target.md) | | |
| [title()](./puppeteer.page.title.md) | | |
| [target()](./puppeteer.page.target.md) | | A target this page was created from. |
| [title()](./puppeteer.page.title.md) | | The page's title |
| [type(selector, text, options)](./puppeteer.page.type.md) | | <p>Sends a <code>keydown</code>, <code>keypress/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 [Keyboard.press()](./puppeteer.keyboard.press.md).</p> |
| [url()](./puppeteer.page.url.md) | | |
| [viewport()](./puppeteer.page.viewport.md) | | |
| [url()](./puppeteer.page.url.md) | | The page's URL. |
| [viewport()](./puppeteer.page.viewport.md) | | Current page viewport settings. |
| [waitForDevicePrompt(options)](./puppeteer.page.waitfordeviceprompt.md) | | <p>This method is typically coupled with an action that triggers a device request from an api such as WebBluetooth.</p><p>:::caution</p><p>This must be called before the device request is made. It will not return a currently active device prompt.</p><p>:::</p> |
| [waitForFileChooser(options)](./puppeteer.page.waitforfilechooser.md) | | <p>This method is typically coupled with an action that triggers file choosing.</p><p>:::caution</p><p>This must be called before the file chooser is launched. It will not return a currently active file chooser.</p><p>:::</p> |
| [waitForFrame(urlOrPredicate, options)](./puppeteer.page.waitforframe.md) | | |
@ -160,4 +160,4 @@ page.off('request', logRequest);
| [waitForSelector(selector, options)](./puppeteer.page.waitforselector.md) | | Wait for the <code>selector</code> to appear in page. If at the moment of calling the method the <code>selector</code> already exists, the method will return immediately. If the <code>selector</code> doesn't appear after the <code>timeout</code> milliseconds of waiting, the function will throw. |
| [waitForTimeout(milliseconds)](./puppeteer.page.waitfortimeout.md) | | |
| [waitForXPath(xpath, options)](./puppeteer.page.waitforxpath.md) | | Wait for the <code>xpath</code> to appear in page. If at the moment of calling the method the <code>xpath</code> already exists, the method will return immediately. If the <code>xpath</code> doesn't appear after the <code>timeout</code> milliseconds of waiting, the function will throw. |
| [workers()](./puppeteer.page.workers.md) | | |
| [workers()](./puppeteer.page.workers.md) | | All of the dedicated [WebWorkers](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) associated with the page. |

View File

@ -4,6 +4,8 @@ sidebar_label: Page.metrics
# Page.metrics() method
Object containing metrics as key/value pairs.
#### Signature:
```typescript
@ -16,8 +18,6 @@ class Page {
Promise&lt;[Metrics](./puppeteer.metrics.md)&gt;
Object containing metrics as key/value pairs.
- `Timestamp` : The timestamp when the metrics sample was taken.
- `Documents` : Number of documents in the page.

View File

@ -4,6 +4,8 @@ sidebar_label: Page.screenshot
# Page.screenshot() method
Captures screenshot of the current page.
#### Signature:
```typescript
@ -49,5 +51,3 @@ Options object which might have the following properties:
- `captureBeyondViewport` : When true, captures screenshot [beyond the viewport](https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-captureScreenshot). When false, falls back to old behaviour, and cuts the screenshot by the viewport size. Defaults to `true`.
- `fromSurface` : When true, captures screenshot [from the surface rather than the view](https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-captureScreenshot). When false, works only in headful mode and ignores page viewport (but not browser window's bounds). Defaults to `true`.
NOTE: Screenshots take at least 1/6 second on OS X. See [https://crbug.com/741689](https://crbug.com/741689) for discussion.

View File

@ -4,6 +4,8 @@ sidebar_label: Page.setContent
# Page.setContent() method
Set the content of the page.
#### Signature:
```typescript

View File

@ -4,6 +4,8 @@ sidebar_label: Page.target
# Page.target() method
A target this page was created from.
#### Signature:
```typescript
@ -15,5 +17,3 @@ class Page {
**Returns:**
[Target](./puppeteer.target.md)
A target this page was created from.

View File

@ -4,6 +4,8 @@ sidebar_label: Page.title
# Page.title() method
The page's title
#### Signature:
```typescript
@ -16,8 +18,6 @@ class Page {
Promise&lt;string&gt;
The page's title
## Remarks
Shortcut for [page.mainFrame().title()](./puppeteer.frame.title.md).

View File

@ -4,6 +4,8 @@ sidebar_label: Page.url
# Page.url() method
The page's URL.
#### Signature:
```typescript

View File

@ -4,6 +4,8 @@ sidebar_label: Page.viewport
# Page.viewport() method
Current page viewport settings.
#### Signature:
```typescript

View File

@ -4,6 +4,8 @@ sidebar_label: Page.workers
# Page.workers() method
All of the dedicated [WebWorkers](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) associated with the page.
#### Signature:
```typescript
@ -16,8 +18,6 @@ class Page {
[WebWorker](./puppeteer.webworker.md)\[\]
all of the dedicated [WebWorkers](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) associated with the page.
## Remarks
This does not contain ServiceWorkers

View File

@ -4,6 +4,8 @@ sidebar_label: PuppeteerNode.executablePath
# PuppeteerNode.executablePath() method
The default executable path.
#### Signature:
```typescript
@ -21,5 +23,3 @@ class PuppeteerNode {
**Returns:**
string
The default executable path.

View File

@ -44,11 +44,11 @@ Once you have created a `page` you have access to a large API to interact with t
## Properties
| Property | Modifiers | Type | Description |
| ------------------- | --------------------- | --------------------------------- | ----------- |
| defaultProduct | <code>readonly</code> | [Product](./puppeteer.product.md) | |
| lastLaunchedProduct | <code>readonly</code> | [Product](./puppeteer.product.md) | |
| product | <code>readonly</code> | string | |
| Property | Modifiers | Type | Description |
| ------------------- | --------------------- | --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| defaultProduct | <code>readonly</code> | [Product](./puppeteer.product.md) | The name of the browser that will be launched by default. For <code>puppeteer</code>, this is influenced by your configuration. Otherwise, it's <code>chrome</code>. |
| lastLaunchedProduct | <code>readonly</code> | [Product](./puppeteer.product.md) | The name of the browser that was last launched. |
| product | <code>readonly</code> | string | |
## Methods
@ -57,5 +57,5 @@ Once you have created a `page` you have access to a large API to interact with t
| [connect(options)](./puppeteer.puppeteernode.connect.md) | | This method attaches Puppeteer to an existing browser instance. |
| [createBrowserFetcher(options)](./puppeteer.puppeteernode.createbrowserfetcher.md) | | |
| [defaultArgs(options)](./puppeteer.puppeteernode.defaultargs.md) | | |
| [executablePath(channel)](./puppeteer.puppeteernode.executablepath.md) | | |
| [executablePath(channel)](./puppeteer.puppeteernode.executablepath.md) | | The default executable path. |
| [launch(options)](./puppeteer.puppeteernode.launch.md) | | <p>Launches a browser instance with given arguments and options when specified.</p><p>When using with <code>puppeteer-core</code>, [options.executablePath](./puppeteer.launchoptions.md) or [options.channel](./puppeteer.launchoptions.md) must be provided.</p> |

View File

@ -4,6 +4,8 @@ sidebar_label: SecurityDetails.issuer
# SecurityDetails.issuer() method
The name of the issuer of the certificate.
#### Signature:
```typescript
@ -15,5 +17,3 @@ class SecurityDetails {
**Returns:**
string
The name of the issuer of the certificate.

View File

@ -18,11 +18,11 @@ The constructor for this class is marked as internal. Third-party code should no
## Methods
| Method | Modifiers | Description |
| ----------------------------------------------------------------------------------- | --------- | ----------- |
| [issuer()](./puppeteer.securitydetails.issuer.md) | | |
| [protocol()](./puppeteer.securitydetails.protocol.md) | | |
| [subjectAlternativeNames()](./puppeteer.securitydetails.subjectalternativenames.md) | | |
| [subjectName()](./puppeteer.securitydetails.subjectname.md) | | |
| [validFrom()](./puppeteer.securitydetails.validfrom.md) | | |
| [validTo()](./puppeteer.securitydetails.validto.md) | | |
| Method | Modifiers | Description |
| ----------------------------------------------------------------------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------- |
| [issuer()](./puppeteer.securitydetails.issuer.md) | | The name of the issuer of the certificate. |
| [protocol()](./puppeteer.securitydetails.protocol.md) | | The security protocol being used, e.g. "TLS 1.2". |
| [subjectAlternativeNames()](./puppeteer.securitydetails.subjectalternativenames.md) | | The list of [subject alternative names (SANs)](https://en.wikipedia.org/wiki/Subject_Alternative_Name) of the certificate. |
| [subjectName()](./puppeteer.securitydetails.subjectname.md) | | The name of the subject to which the certificate was issued. |
| [validFrom()](./puppeteer.securitydetails.validfrom.md) | | [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) marking the start of the certificate's validity. |
| [validTo()](./puppeteer.securitydetails.validto.md) | | [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) marking the end of the certificate's validity. |

View File

@ -4,6 +4,8 @@ sidebar_label: SecurityDetails.protocol
# SecurityDetails.protocol() method
The security protocol being used, e.g. "TLS 1.2".
#### Signature:
```typescript
@ -15,5 +17,3 @@ class SecurityDetails {
**Returns:**
string
The security protocol being used, e.g. "TLS 1.2".

View File

@ -4,6 +4,8 @@ sidebar_label: SecurityDetails.subjectAlternativeNames
# SecurityDetails.subjectAlternativeNames() method
The list of [subject alternative names (SANs)](https://en.wikipedia.org/wiki/Subject_Alternative_Name) of the certificate.
#### Signature:
```typescript
@ -15,5 +17,3 @@ class SecurityDetails {
**Returns:**
string\[\]
The list of [subject alternative names (SANs)](https://en.wikipedia.org/wiki/Subject_Alternative_Name) of the certificate.

View File

@ -4,6 +4,8 @@ sidebar_label: SecurityDetails.subjectName
# SecurityDetails.subjectName() method
The name of the subject to which the certificate was issued.
#### Signature:
```typescript
@ -15,5 +17,3 @@ class SecurityDetails {
**Returns:**
string
The name of the subject to which the certificate was issued.

View File

@ -4,6 +4,8 @@ sidebar_label: SecurityDetails.validFrom
# SecurityDetails.validFrom() method
[Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) marking the start of the certificate's validity.
#### Signature:
```typescript
@ -15,5 +17,3 @@ class SecurityDetails {
**Returns:**
number
[Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) marking the start of the certificate's validity.

View File

@ -4,6 +4,8 @@ sidebar_label: SecurityDetails.validTo
# SecurityDetails.validTo() method
[Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) marking the end of the certificate's validity.
#### Signature:
```typescript
@ -15,5 +17,3 @@ class SecurityDetails {
**Returns:**
number
[Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) marking the end of the certificate's validity.

View File

@ -42,4 +42,4 @@ for (const worker of page.workers()) {
| ----------------------------------------------------------------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [evaluate(pageFunction, args)](./puppeteer.webworker.evaluate.md) | | If the function passed to the <code>worker.evaluate</code> returns a Promise, then <code>worker.evaluate</code> would wait for the promise to resolve and return its value. If the function passed to the <code>worker.evaluate</code> returns a non-serializable value, then <code>worker.evaluate</code> resolves to <code>undefined</code>. DevTools Protocol also supports transferring some additional values that are not serializable by <code>JSON</code>: <code>-0</code>, <code>NaN</code>, <code>Infinity</code>, <code>-Infinity</code>, and bigint literals. Shortcut for <code>await worker.executionContext()).evaluate(pageFunction, ...args)</code>. |
| [evaluateHandle(pageFunction, args)](./puppeteer.webworker.evaluatehandle.md) | | The only difference between <code>worker.evaluate</code> and <code>worker.evaluateHandle</code> is that <code>worker.evaluateHandle</code> returns in-page object (JSHandle). If the function passed to the <code>worker.evaluateHandle</code> returns a <code>Promise</code>, then <code>worker.evaluateHandle</code> would wait for the promise to resolve and return its value. Shortcut for <code>await worker.executionContext()).evaluateHandle(pageFunction, ...args)</code> |
| [url()](./puppeteer.webworker.url.md) | | |
| [url()](./puppeteer.webworker.url.md) | | The URL of this web worker. |

View File

@ -4,6 +4,8 @@ sidebar_label: WebWorker.url
# WebWorker.url() method
The URL of this web worker.
#### Signature:
```typescript
@ -15,5 +17,3 @@ class WebWorker {
**Returns:**
string
The URL of this web worker.

View File

@ -142,14 +142,14 @@ export class HTTPRequest {
constructor() {}
/**
* @returns the URL of the request
* The URL of the request
*/
url(): string {
throw new Error('Not implemented');
}
/**
* @returns the `ContinueRequestOverrides` that will be used
* The `ContinueRequestOverrides` that will be used
* if the interception is allowed to continue (ie, `abort()` and
* `respond()` aren't called).
*/
@ -158,7 +158,7 @@ export class HTTPRequest {
}
/**
* @returns The `ResponseForRequest` that gets used if the
* The `ResponseForRequest` that gets used if the
* interception is allowed to respond (ie, `abort()` is not called).
*/
responseForRequest(): Partial<ResponseForRequest> | null {
@ -166,14 +166,14 @@ export class HTTPRequest {
}
/**
* @returns the most recent reason for aborting the request
* The most recent reason for aborting the request
*/
abortErrorReason(): Protocol.Network.ErrorReason | null {
throw new Error('Not implemented');
}
/**
* @returns An InterceptResolutionState object describing the current resolution
* An InterceptResolutionState object describing the current resolution
* action and priority.
*
* InterceptResolutionState contains:
@ -188,7 +188,7 @@ export class HTTPRequest {
}
/**
* @returns `true` if the intercept resolution has already been handled,
* Is `true` if the intercept resolution has already been handled,
* `false` otherwise.
*/
isInterceptResolutionHandled(): boolean {
@ -225,21 +225,21 @@ export class HTTPRequest {
}
/**
* @returns the method used (`GET`, `POST`, etc.)
* The method used (`GET`, `POST`, etc.)
*/
method(): string {
throw new Error('Not implemented');
}
/**
* @returns the request's post body, if any.
* The request's post body, if any.
*/
postData(): string | undefined {
throw new Error('Not implemented');
}
/**
* @returns an object with HTTP headers associated with the request. All
* An object with HTTP headers associated with the request. All
* header names are lower-case.
*/
headers(): Record<string, string> {
@ -247,7 +247,7 @@ export class HTTPRequest {
}
/**
* @returns A matching `HTTPResponse` object, or null if the response has not
* A matching `HTTPResponse` object, or null if the response has not
* been received yet.
*/
response(): HTTPResponse | null {
@ -255,7 +255,7 @@ export class HTTPRequest {
}
/**
* @returns the frame that initiated the request, or null if navigating to
* The frame that initiated the request, or null if navigating to
* error pages.
*/
frame(): Frame | null {
@ -263,14 +263,14 @@ export class HTTPRequest {
}
/**
* @returns true if the request is the driver of the current frame's navigation.
* True if the request is the driver of the current frame's navigation.
*/
isNavigationRequest(): boolean {
throw new Error('Not implemented');
}
/**
* @returns the initiator of the request.
* The initiator of the request.
*/
initiator(): Protocol.Network.Initiator {
throw new Error('Not implemented');

View File

@ -49,7 +49,7 @@ export class HTTPResponse {
}
/**
* @returns The IP address and port number used to connect to the remote
* The IP address and port number used to connect to the remote
* server.
*/
remoteAddress(): RemoteAddress {
@ -57,28 +57,28 @@ export class HTTPResponse {
}
/**
* @returns The URL of the response.
* The URL of the response.
*/
url(): string {
throw new Error('Not implemented');
}
/**
* @returns True if the response was successful (status in the range 200-299).
* True if the response was successful (status in the range 200-299).
*/
ok(): boolean {
throw new Error('Not implemented');
}
/**
* @returns The status code of the response (e.g., 200 for a success).
* The status code of the response (e.g., 200 for a success).
*/
status(): number {
throw new Error('Not implemented');
}
/**
* @returns The status text of the response (e.g. usually an "OK" for a
* The status text of the response (e.g. usually an "OK" for a
* success).
*/
statusText(): string {
@ -86,7 +86,7 @@ export class HTTPResponse {
}
/**
* @returns An object with HTTP headers associated with the response. All
* An object with HTTP headers associated with the response. All
* header names are lower-case.
*/
headers(): Record<string, string> {
@ -94,7 +94,7 @@ export class HTTPResponse {
}
/**
* @returns {@link SecurityDetails} if the response was received over the
* {@link SecurityDetails} if the response was received over the
* secure connection, or `null` otherwise.
*/
securityDetails(): SecurityDetails | null {
@ -102,21 +102,21 @@ export class HTTPResponse {
}
/**
* @returns Timing information related to the response.
* Timing information related to the response.
*/
timing(): Protocol.Network.ResourceTiming | null {
throw new Error('Not implemented');
}
/**
* @returns Promise which resolves to a buffer with response body.
* Promise which resolves to a buffer with response body.
*/
buffer(): Promise<Buffer> {
throw new Error('Not implemented');
}
/**
* @returns Promise which resolves to a text representation of response body.
* Promise which resolves to a text representation of response body.
*/
async text(): Promise<string> {
const content = await this.buffer();
@ -124,8 +124,7 @@ export class HTTPResponse {
}
/**
*
* @returns Promise which resolves to a JSON representation of response body.
* Promise which resolves to a JSON representation of response body.
*
* @remarks
*
@ -138,14 +137,14 @@ export class HTTPResponse {
}
/**
* @returns A matching {@link HTTPRequest} object.
* A matching {@link HTTPRequest} object.
*/
request(): HTTPRequest {
throw new Error('Not implemented');
}
/**
* @returns True if the response was served from either the browser's disk
* True if the response was served from either the browser's disk
* cache or memory cache.
*/
fromCache(): boolean {
@ -153,14 +152,14 @@ export class HTTPResponse {
}
/**
* @returns True if the response was served by a service worker.
* True if the response was served by a service worker.
*/
fromServiceWorker(): boolean {
throw new Error('Not implemented');
}
/**
* @returns A {@link Frame} that initiated this response, or `null` if
* A {@link Frame} that initiated this response, or `null` if
* navigating to error pages.
*/
frame(): Frame | null {

View File

@ -143,7 +143,7 @@ export class JSHandle<T = unknown> {
}
/**
* @returns A vanilla object representing the serializable portions of the
* A vanilla object representing the serializable portions of the
* referenced object.
* @throws Throws if the object cannot be serialized due to circularity.
*
@ -155,7 +155,7 @@ export class JSHandle<T = unknown> {
}
/**
* @returns Either `null` or the handle itself if the handle is an
* Either `null` or the handle itself if the handle is an
* instance of {@link ElementHandle}.
*/
asElement(): ElementHandle<Node> | null {

View File

@ -450,14 +450,14 @@ export class Page extends EventEmitter {
}
/**
* @returns `true` if drag events are being intercepted, `false` otherwise.
* `true` if drag events are being intercepted, `false` otherwise.
*/
isDragInterceptionEnabled(): boolean {
throw new Error('Not implemented');
}
/**
* @returns `true` if the page has JavaScript enabled, `false` otherwise.
* `true` if the page has JavaScript enabled, `false` otherwise.
*/
isJavaScriptEnabled(): boolean {
throw new Error('Not implemented');
@ -566,7 +566,7 @@ export class Page extends EventEmitter {
}
/**
* @returns A target this page was created from.
* A target this page was created from.
*/
target(): Target {
throw new Error('Not implemented');
@ -587,7 +587,7 @@ export class Page extends EventEmitter {
}
/**
* @returns The page's main frame.
* The page's main frame.
*
* @remarks
* Page is guaranteed to have a main frame which persists during navigations.
@ -632,14 +632,14 @@ export class Page extends EventEmitter {
}
/**
* @returns An array of all frames attached to the page.
* An array of all frames attached to the page.
*/
frames(): Frame[] {
throw new Error('Not implemented');
}
/**
* @returns all of the dedicated {@link
* All of the dedicated {@link
* https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API |
* WebWorkers} associated with the page.
*
@ -781,7 +781,7 @@ export class Page extends EventEmitter {
}
/**
* @returns Maximum time in milliseconds.
* Maximum time in milliseconds.
*/
getDefaultTimeout(): number {
throw new Error('Not implemented');
@ -1292,7 +1292,9 @@ export class Page extends EventEmitter {
}
/**
* @returns Object containing metrics as key/value pairs.
* Object containing metrics as key/value pairs.
*
* @returns
*
* - `Timestamp` : The timestamp when the metrics sample was taken.
*
@ -1330,8 +1332,7 @@ export class Page extends EventEmitter {
}
/**
*
* @returns
* The page's URL.
* @remarks Shortcut for
* {@link Frame.url | page.mainFrame().url()}.
*/
@ -1339,11 +1340,16 @@ export class Page extends EventEmitter {
throw new Error('Not implemented');
}
/**
* The full HTML contents of the page, including the DOCTYPE.
*/
async content(): Promise<string> {
throw new Error('Not implemented');
}
/**
* Set the content of the page.
*
* @param html - HTML markup to assign to the page.
* @param options - Parameters that has some properties.
* @remarks
@ -1963,6 +1969,8 @@ export class Page extends EventEmitter {
}
/**
* Current page viewport settings.
*
* @returns
*
* - `width`: page's width in pixels
@ -2123,6 +2131,8 @@ export class Page extends EventEmitter {
}
/**
* Captures screenshot of the current page.
*
* @remarks
* Options object which might have the following properties:
*
@ -2166,8 +2176,6 @@ export class Page extends EventEmitter {
* headful mode and ignores page viewport (but not browser window's
* bounds). Defaults to `true`.
*
* NOTE: Screenshots take at least 1/6 second on OS X. See
* {@link https://crbug.com/741689} for discussion.
* @returns Promise which resolves to buffer or a base64 string (depending on
* the value of `encoding`) with captured screenshot.
*/
@ -2266,7 +2274,8 @@ export class Page extends EventEmitter {
}
/**
* @returns The page's title
* The page's title
*
* @remarks
* Shortcut for {@link Frame.title | page.mainFrame().title()}.
*/

View File

@ -57,7 +57,6 @@ export class ChromeTargetManager extends EventEmitter implements TargetManager {
*/
#attachedTargetsByTargetId: Map<string, Target> = new Map();
/**
*
* Tracks which sessions attach to which target.
*/
#attachedTargetsBySessionId: Map<string, Target> = new Map();

View File

@ -87,35 +87,35 @@ export class ConsoleMessage {
}
/**
* @returns The type of the console message.
* The type of the console message.
*/
type(): ConsoleMessageType {
return this.#type;
}
/**
* @returns The text of the console message.
* The text of the console message.
*/
text(): string {
return this.#text;
}
/**
* @returns An array of arguments passed to the console.
* An array of arguments passed to the console.
*/
args(): JSHandle[] {
return this.#args;
}
/**
* @returns The location of the console message.
* The location of the console message.
*/
location(): ConsoleMessageLocation {
return this.#stackTraceLocations[0] ?? {};
}
/**
* @returns The array of locations on the stack of the console message.
* The array of locations on the stack of the console message.
*/
stackTrace(): ConsoleMessageLocation[] {
return this.#stackTraceLocations;

View File

@ -158,7 +158,7 @@ export class Coverage {
}
/**
* @returns Promise that resolves to the array of coverage reports for
* Promise that resolves to the array of coverage reports for
* all scripts.
*
* @remarks
@ -179,8 +179,9 @@ export class Coverage {
}
/**
* @returns Promise that resolves to the array of coverage reports
* Promise that resolves to the array of coverage reports
* for all stylesheets.
*
* @remarks
* CSS Coverage doesn't include dynamically injected style tags
* without sourceURLs.

View File

@ -26,11 +26,11 @@ import {scriptInjector} from './ScriptInjector.js';
*/
export interface CustomQueryHandler {
/**
* @returns A {@link https://developer.mozilla.org/en-US/docs/Web/API/Node | Node} matching the given `selector` from {@link https://developer.mozilla.org/en-US/docs/Web/API/Node | node}.
* Searches for a {@link https://developer.mozilla.org/en-US/docs/Web/API/Node | Node} matching the given `selector` from {@link https://developer.mozilla.org/en-US/docs/Web/API/Node | node}.
*/
queryOne?: (node: Node, selector: string) => Node | null;
/**
* @returns Some {@link https://developer.mozilla.org/en-US/docs/Web/API/Node | Nodes} matching the given `selector` from {@link https://developer.mozilla.org/en-US/docs/Web/API/Node | node}.
* Searches for some {@link https://developer.mozilla.org/en-US/docs/Web/API/Node | Nodes} matching the given `selector` from {@link https://developer.mozilla.org/en-US/docs/Web/API/Node | node}.
*/
queryAll?: (node: Node, selector: string) => Iterable<Node>;
}

View File

@ -67,21 +67,21 @@ export class Dialog {
}
/**
* @returns The type of the dialog.
* The type of the dialog.
*/
type(): Protocol.Page.DialogType {
return this.#type;
}
/**
* @returns The message displayed in the dialog.
* The message displayed in the dialog.
*/
message(): string {
return this.#message;
}
/**
* @returns The default value of the prompt, or an empty string if the dialog
* The default value of the prompt, or an empty string if the dialog
* is not a `prompt`.
*/
defaultValue(): string {
@ -89,10 +89,11 @@ export class Dialog {
}
/**
* A promise that resolves when the dialog has been accepted.
*
* @param promptText - optional text that will be entered in the dialog
* prompt. Has no effect if the dialog's type is not `prompt`.
*
* @returns A promise that resolves when the dialog has been accepted.
*/
async accept(promptText?: string): Promise<void> {
assert(!this.#handled, 'Cannot accept dialog which is already handled!');
@ -104,7 +105,7 @@ export class Dialog {
}
/**
* @returns A promise which will resolve once the dialog has been dismissed
* A promise which will resolve once the dialog has been dismissed
*/
async dismiss(): Promise<void> {
assert(!this.#handled, 'Cannot dismiss dialog which is already handled!');

View File

@ -241,14 +241,14 @@ export class Frame {
}
/**
* @returns The page associated with the frame.
* The page associated with the frame.
*/
page(): Page {
return this._frameManager.page();
}
/**
* @returns `true` if the frame is an out-of-process (OOP) frame. Otherwise,
* Is `true` if the frame is an out-of-process (OOP) frame. Otherwise,
* `false`.
*/
isOOPFrame(): boolean {
@ -714,7 +714,7 @@ export class Frame {
}
/**
* @returns The full HTML contents of the frame, including the DOCTYPE.
* The full HTML contents of the frame, including the DOCTYPE.
*/
async content(): Promise<string> {
return this.worlds[PUPPETEER_WORLD].content();
@ -738,7 +738,7 @@ export class Frame {
}
/**
* @returns The frame's `name` attribute as specified in the tag.
* The frame's `name` attribute as specified in the tag.
*
* @remarks
* If the name is empty, it returns the `id` attribute instead.
@ -752,28 +752,28 @@ export class Frame {
}
/**
* @returns The frame's URL.
* The frame's URL.
*/
url(): string {
return this.#url;
}
/**
* @returns The parent frame, if any. Detached and main frames return `null`.
* The parent frame, if any. Detached and main frames return `null`.
*/
parentFrame(): Frame | null {
return this._frameManager._frameTree.parentFrame(this._id) || null;
}
/**
* @returns An array of child frames.
* An array of child frames.
*/
childFrames(): Frame[] {
return this._frameManager._frameTree.childFrames(this._id);
}
/**
* @returns `true` if the frame has been detached. Otherwise, `false`.
* Is`true` if the frame has been detached. Otherwise, `false`.
*/
isDetached(): boolean {
return this.#detached;
@ -1082,7 +1082,7 @@ export class Frame {
}
/**
* @returns the frame's title.
* The frame's title.
*/
async title(): Promise<string> {
return this.worlds[PUPPETEER_WORLD].title();

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