chore: release main (#12118)

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
This commit is contained in:
release-please[bot] 2024-03-25 13:03:57 +00:00 committed by GitHub
parent 6be72f315b
commit bf1fd1e828
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
783 changed files with 26966 additions and 6415 deletions

View File

@ -1,6 +1,6 @@
{ {
"packages/puppeteer": "22.6.0", "packages/puppeteer": "22.6.1",
"packages/puppeteer-core": "22.6.0", "packages/puppeteer-core": "22.6.1",
"packages/testserver": "0.6.0", "packages/testserver": "0.6.0",
"packages/ng-schematics": "0.6.0", "packages/ng-schematics": "0.6.0",
"packages/browsers": "2.2.0" "packages/browsers": "2.2.0"

6
package-lock.json generated
View File

@ -12157,14 +12157,14 @@
} }
}, },
"packages/puppeteer": { "packages/puppeteer": {
"version": "22.6.0", "version": "22.6.1",
"hasInstallScript": true, "hasInstallScript": true,
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@puppeteer/browsers": "2.2.0", "@puppeteer/browsers": "2.2.0",
"cosmiconfig": "9.0.0", "cosmiconfig": "9.0.0",
"devtools-protocol": "0.0.1262051", "devtools-protocol": "0.0.1262051",
"puppeteer-core": "22.6.0" "puppeteer-core": "22.6.1"
}, },
"bin": { "bin": {
"puppeteer": "lib/esm/puppeteer/node/cli.js" "puppeteer": "lib/esm/puppeteer/node/cli.js"
@ -12177,7 +12177,7 @@
} }
}, },
"packages/puppeteer-core": { "packages/puppeteer-core": {
"version": "22.6.0", "version": "22.6.1",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@puppeteer/browsers": "2.2.0", "@puppeteer/browsers": "2.2.0",

View File

@ -20,6 +20,15 @@ All notable changes to this project will be documented in this file. See [standa
* dependencies * dependencies
* @puppeteer/browsers bumped from 1.5.1 to 1.6.0 * @puppeteer/browsers bumped from 1.5.1 to 1.6.0
## [22.6.1](https://github.com/puppeteer/puppeteer/compare/puppeteer-core-v22.6.0...puppeteer-core-v22.6.1) (2024-03-25)
### Bug Fixes
* apply timeout to waiting for a response ([#12142](https://github.com/puppeteer/puppeteer/issues/12142)) ([ac1767d](https://github.com/puppeteer/puppeteer/commit/ac1767da0b4214ced548a62dd737e2863f92c715))
* reload should not resolve early on fragment navigations ([#12119](https://github.com/puppeteer/puppeteer/issues/12119)) ([d476031](https://github.com/puppeteer/puppeteer/commit/d4760317c9bd359c9ecdb5f36231449dae16a8d2))
* support clip in ElementHandle.screenshot ([#12115](https://github.com/puppeteer/puppeteer/issues/12115)) ([b096ffa](https://github.com/puppeteer/puppeteer/commit/b096ffaa0359078bd5748b53b67e87c9453c7196))
## [22.6.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-core-v22.5.0...puppeteer-core-v22.6.0) (2024-03-20) ## [22.6.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-core-v22.5.0...puppeteer-core-v22.6.0) (2024-03-20)

View File

@ -1,6 +1,6 @@
{ {
"name": "puppeteer-core", "name": "puppeteer-core",
"version": "22.6.0", "version": "22.6.1",
"description": "A high-level API to control headless Chrome over the DevTools Protocol", "description": "A high-level API to control headless Chrome over the DevTools Protocol",
"keywords": [ "keywords": [
"puppeteer", "puppeteer",

View File

@ -29,6 +29,20 @@ All notable changes to this project will be documented in this file. See [standa
* puppeteer-core bumped from 21.0.2 to 21.0.3 * puppeteer-core bumped from 21.0.2 to 21.0.3
* @puppeteer/browsers bumped from 1.5.1 to 1.6.0 * @puppeteer/browsers bumped from 1.5.1 to 1.6.0
## [22.6.1](https://github.com/puppeteer/puppeteer/compare/puppeteer-v22.6.0...puppeteer-v22.6.1) (2024-03-25)
### Miscellaneous Chores
* **puppeteer:** Synchronize puppeteer versions
### Dependencies
* The following workspace dependencies were updated
* dependencies
* puppeteer-core bumped from 22.6.0 to 22.6.1
## [22.6.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v22.5.0...puppeteer-v22.6.0) (2024-03-20) ## [22.6.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v22.5.0...puppeteer-v22.6.0) (2024-03-20)

View File

@ -1,6 +1,6 @@
{ {
"name": "puppeteer", "name": "puppeteer",
"version": "22.6.0", "version": "22.6.1",
"description": "A high-level API to control headless Chrome over the DevTools Protocol", "description": "A high-level API to control headless Chrome over the DevTools Protocol",
"keywords": [ "keywords": [
"puppeteer", "puppeteer",
@ -124,7 +124,7 @@
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"cosmiconfig": "9.0.0", "cosmiconfig": "9.0.0",
"puppeteer-core": "22.6.0", "puppeteer-core": "22.6.1",
"@puppeteer/browsers": "2.2.0", "@puppeteer/browsers": "2.2.0",
"devtools-protocol": "0.0.1262051" "devtools-protocol": "0.0.1262051"
}, },

View File

@ -1,212 +0,0 @@
---
sidebar_label: API
---
# API Reference
## Classes
| Class | Description |
| --------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Accessibility](./puppeteer.accessibility.md) | The Accessibility class provides methods for inspecting the browser's accessibility tree. The accessibility tree is used by assistive technology such as [screen readers](https://en.wikipedia.org/wiki/Screen_reader) or [switches](https://en.wikipedia.org/wiki/Switch_access). |
| [Browser](./puppeteer.browser.md) | <p>[Browser](./puppeteer.browser.md) represents a browser instance that is either:</p><p>- connected to via [Puppeteer.connect()](./puppeteer.puppeteer.connect.md) or - launched by [PuppeteerNode.launch()](./puppeteer.puppeteernode.launch.md).</p><p>[Browser](./puppeteer.browser.md) [emits](./puppeteer.eventemitter.md) various events which are documented in the [BrowserEvent](./puppeteer.browserevent.md) enum.</p> |
| [BrowserContext](./puppeteer.browsercontext.md) | <p>[BrowserContext](./puppeteer.browsercontext.md) represents individual user contexts within a [browser](./puppeteer.browser.md).</p><p>When a [browser](./puppeteer.browser.md) is launched, it has a single [browser context](./puppeteer.browsercontext.md) by default. Others can be created using [Browser.createBrowserContext()](./puppeteer.browser.createbrowsercontext.md). Each context has isolated storage (cookies/localStorage/etc.)</p><p>[BrowserContext](./puppeteer.browsercontext.md) [emits](./puppeteer.eventemitter.md) various events which are documented in the [BrowserContextEvent](./puppeteer.browsercontextevent.md) enum.</p><p>If a [page](./puppeteer.page.md) opens another [page](./puppeteer.page.md), e.g. using <code>window.open</code>, the popup will belong to the parent [page's browser context](./puppeteer.page.browsercontext.md).</p> |
| [CDPSession](./puppeteer.cdpsession.md) | The <code>CDPSession</code> instances are used to talk raw Chrome Devtools Protocol. |
| [Connection](./puppeteer.connection.md) | |
| [ConsoleMessage](./puppeteer.consolemessage.md) | ConsoleMessage objects are dispatched by page via the 'console' event. |
| [Coverage](./puppeteer.coverage.md) | The Coverage class provides methods to gather information about parts of JavaScript and CSS that were used by the page. |
| [CSSCoverage](./puppeteer.csscoverage.md) | |
| [DeviceRequestPrompt](./puppeteer.devicerequestprompt.md) | Device request prompts let you respond to the page requesting for a device through an API like WebBluetooth. |
| [DeviceRequestPromptDevice](./puppeteer.devicerequestpromptdevice.md) | Device in a request prompt. |
| [Dialog](./puppeteer.dialog.md) | Dialog instances are dispatched by the [Page](./puppeteer.page.md) via the <code>dialog</code> event. |
| [ElementHandle](./puppeteer.elementhandle.md) | ElementHandle represents an in-page DOM element. |
| [EventEmitter](./puppeteer.eventemitter.md) | The EventEmitter class that many Puppeteer classes extend. |
| [FileChooser](./puppeteer.filechooser.md) | File choosers let you react to the page requesting for a file. |
| [Frame](./puppeteer.frame.md) | <p>Represents a DOM frame.</p><p>To understand frames, you can think of frames as <code>&lt;iframe&gt;</code> elements. Just like iframes, frames can be nested, and when JavaScript is executed in a frame, the JavaScript does not effect frames inside the ambient frame the JavaScript executes in.</p> |
| [HTTPRequest](./puppeteer.httprequest.md) | Represents an HTTP request sent by a page. |
| [HTTPResponse](./puppeteer.httpresponse.md) | The HTTPResponse class represents responses which are received by the [Page](./puppeteer.page.md) class. |
| [JSCoverage](./puppeteer.jscoverage.md) | |
| [JSHandle](./puppeteer.jshandle.md) | <p>Represents a reference to a JavaScript object. Instances can be created using [Page.evaluateHandle()](./puppeteer.page.evaluatehandle.md).</p><p>Handles prevent the referenced JavaScript object from being garbage-collected unless the handle is purposely [disposed](./puppeteer.jshandle.dispose.md). JSHandles are auto-disposed when their associated frame is navigated away or the parent context gets destroyed.</p><p>Handles can be used as arguments for any evaluation function such as [Page.$eval()](./puppeteer.page._eval.md), [Page.evaluate()](./puppeteer.page.evaluate.md), and [Page.evaluateHandle()](./puppeteer.page.evaluatehandle.md). They are resolved to their referenced object.</p> |
| [Keyboard](./puppeteer.keyboard.md) | Keyboard provides an api for managing a virtual keyboard. The high level api is [Keyboard.type()](./puppeteer.keyboard.type.md), which takes raw characters and generates proper keydown, keypress/input, and keyup events on your page. |
| [Locator](./puppeteer.locator.md) | Locators describe a strategy of locating objects and performing an action on them. If the action fails because the object is not ready for the action, the whole operation is retried. Various preconditions for a successful action are checked automatically. |
| [Mouse](./puppeteer.mouse.md) | The Mouse class operates in main-frame CSS pixels relative to the top-left corner of the viewport. |
| [Page](./puppeteer.page.md) | <p>Page provides methods to interact with a single tab or [extension background page](https://developer.chrome.com/extensions/background_pages) in the browser.</p><p>:::note</p><p>One Browser instance might have multiple Page instances.</p><p>:::</p> |
| [ProductLauncher](./puppeteer.productlauncher.md) | Describes a launcher - a class that is able to create and launch a browser instance. |
| [ProtocolError](./puppeteer.protocolerror.md) | ProtocolError is emitted whenever there is an error from the protocol. |
| [Puppeteer](./puppeteer.puppeteer.md) | <p>The main Puppeteer class.</p><p>IMPORTANT: if you are using Puppeteer in a Node environment, you will get an instance of [PuppeteerNode](./puppeteer.puppeteernode.md) when you import or require <code>puppeteer</code>. That class extends <code>Puppeteer</code>, so has all the methods documented below as well as all that are defined on [PuppeteerNode](./puppeteer.puppeteernode.md).</p> |
| [PuppeteerError](./puppeteer.puppeteererror.md) | The base class for all Puppeteer-specific errors |
| [PuppeteerNode](./puppeteer.puppeteernode.md) | <p>Extends the main [Puppeteer](./puppeteer.puppeteer.md) class with Node specific behaviour for fetching and downloading browsers.</p><p>If you're using Puppeteer in a Node environment, this is the class you'll get when you run <code>require('puppeteer')</code> (or the equivalent ES <code>import</code>).</p> |
| [ScreenRecorder](./puppeteer.screenrecorder.md) | |
| [SecurityDetails](./puppeteer.securitydetails.md) | The SecurityDetails class represents the security details of a response that was received over a secure connection. |
| [Target](./puppeteer.target.md) | Target represents a [CDP target](https://chromedevtools.github.io/devtools-protocol/tot/Target/). In CDP a target is something that can be debugged such a frame, a page or a worker. |
| [TimeoutError](./puppeteer.timeouterror.md) | TimeoutError is emitted whenever certain operations are terminated due to timeout. |
| [Touchscreen](./puppeteer.touchscreen.md) | The Touchscreen class exposes touchscreen events. |
| [Tracing](./puppeteer.tracing.md) | The Tracing class exposes the tracing audit interface. |
| [UnsupportedOperation](./puppeteer.unsupportedoperation.md) | Puppeteer will throw this error if a method is not supported by the currently used protocol |
| [WebWorker](./puppeteer.webworker.md) | This class represents a [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API). |
## Enumerations
| Enumeration | Description |
| --------------------------------------------------------------------- | --------------------------------------------------------------------- |
| [BrowserContextEvent](./puppeteer.browsercontextevent.md) | |
| [BrowserEvent](./puppeteer.browserevent.md) | All the events a [browser instance](./puppeteer.browser.md) may emit. |
| [InterceptResolutionAction](./puppeteer.interceptresolutionaction.md) | |
| [LocatorEvent](./puppeteer.locatorevent.md) | All the events that a locator instance may emit. |
| [PageEvent](./puppeteer.pageevent.md) | All the events that a page instance may emit. |
| [TargetType](./puppeteer.targettype.md) | |
## Functions
| Function | Description |
| -------------------------------------------------------------------------------------- | ----------- |
| [clearCustomQueryHandlers()](./puppeteer.clearcustomqueryhandlers.md) | |
| [connect(options)](./puppeteer.connect.md) | |
| [customQueryHandlerNames()](./puppeteer.customqueryhandlernames.md) | |
| [defaultArgs(options)](./puppeteer.defaultargs.md) | |
| [executablePath(channel)](./puppeteer.executablepath.md) | |
| [launch(options)](./puppeteer.launch.md) | |
| [registerCustomQueryHandler(name, handler)](./puppeteer.registercustomqueryhandler.md) | |
| [trimCache()](./puppeteer.trimcache.md) | |
| [unregisterCustomQueryHandler(name)](./puppeteer.unregistercustomqueryhandler.md) | |
## Interfaces
| Interface | Description |
| --------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [ActionOptions](./puppeteer.actionoptions.md) | |
| [AutofillData](./puppeteer.autofilldata.md) | |
| [BoundingBox](./puppeteer.boundingbox.md) | |
| [BoxModel](./puppeteer.boxmodel.md) | |
| [BrowserConnectOptions](./puppeteer.browserconnectoptions.md) | Generic browser options that can be passed when launching any browser or when connecting to an existing browser instance. |
| [BrowserContextEvents](./puppeteer.browsercontextevents.md) | |
| [BrowserContextOptions](./puppeteer.browsercontextoptions.md) | |
| [BrowserEvents](./puppeteer.browserevents.md) | |
| [BrowserLaunchArgumentOptions](./puppeteer.browserlaunchargumentoptions.md) | Launcher options that only apply to Chrome. |
| [CDPSessionEvents](./puppeteer.cdpsessionevents.md) | |
| [ClickOptions](./puppeteer.clickoptions.md) | |
| [CommandOptions](./puppeteer.commandoptions.md) | |
| [CommonEventEmitter](./puppeteer.commoneventemitter.md) | |
| [Configuration](./puppeteer.configuration.md) | <p>Defines options to configure Puppeteer's behavior during installation and runtime.</p><p>See individual properties for more information.</p> |
| [ConnectionTransport](./puppeteer.connectiontransport.md) | |
| [ConnectOptions](./puppeteer.connectoptions.md) | |
| [ConsoleMessageLocation](./puppeteer.consolemessagelocation.md) | |
| [ContinueRequestOverrides](./puppeteer.continuerequestoverrides.md) | |
| [Cookie](./puppeteer.cookie.md) | Represents a cookie object. |
| [CookieParam](./puppeteer.cookieparam.md) | Cookie parameter object |
| [CoverageEntry](./puppeteer.coverageentry.md) | The CoverageEntry class represents one entry of the coverage report. |
| [Credentials](./puppeteer.credentials.md) | |
| [CSSCoverageOptions](./puppeteer.csscoverageoptions.md) | Set of configurable options for CSS coverage. |
| [CustomQueryHandler](./puppeteer.customqueryhandler.md) | |
| [DebugInfo](./puppeteer.debuginfo.md) | |
| [DeleteCookiesRequest](./puppeteer.deletecookiesrequest.md) | |
| [Device](./puppeteer.device.md) | |
| [ElementScreenshotOptions](./puppeteer.elementscreenshotoptions.md) | |
| [FrameAddScriptTagOptions](./puppeteer.frameaddscripttagoptions.md) | |
| [FrameAddStyleTagOptions](./puppeteer.frameaddstyletagoptions.md) | |
| [FrameEvents](./puppeteer.frameevents.md) | |
| [FrameWaitForFunctionOptions](./puppeteer.framewaitforfunctionoptions.md) | |
| [GeolocationOptions](./puppeteer.geolocationoptions.md) | |
| [GoToOptions](./puppeteer.gotooptions.md) | |
| [InterceptResolutionState](./puppeteer.interceptresolutionstate.md) | |
| [InternalNetworkConditions](./puppeteer.internalnetworkconditions.md) | |
| [JSCoverageEntry](./puppeteer.jscoverageentry.md) | The CoverageEntry class for JavaScript |
| [JSCoverageOptions](./puppeteer.jscoverageoptions.md) | Set of configurable options for JS coverage. |
| [KeyboardTypeOptions](./puppeteer.keyboardtypeoptions.md) | |
| [KeyDownOptions](./puppeteer.keydownoptions.md) | |
| [LaunchOptions](./puppeteer.launchoptions.md) | Generic launch options that can be passed when launching any browser. |
| [LocatorEvents](./puppeteer.locatorevents.md) | |
| [LocatorOptions](./puppeteer.locatoroptions.md) | |
| [LocatorScrollOptions](./puppeteer.locatorscrolloptions.md) | |
| [MediaFeature](./puppeteer.mediafeature.md) | |
| [Metrics](./puppeteer.metrics.md) | |
| [MouseClickOptions](./puppeteer.mouseclickoptions.md) | |
| [MouseMoveOptions](./puppeteer.mousemoveoptions.md) | |
| [MouseOptions](./puppeteer.mouseoptions.md) | |
| [MouseWheelOptions](./puppeteer.mousewheeloptions.md) | |
| [Moveable](./puppeteer.moveable.md) | |
| [NetworkConditions](./puppeteer.networkconditions.md) | |
| [NewDocumentScriptEvaluation](./puppeteer.newdocumentscriptevaluation.md) | |
| [Offset](./puppeteer.offset.md) | |
| [PageEvents](./puppeteer.pageevents.md) | <p>Denotes the objects received by callback functions for page events.</p><p>See [PageEvent](./puppeteer.pageevent.md) for more detail on the events and when they are emitted.</p> |
| [PDFMargin](./puppeteer.pdfmargin.md) | |
| [PDFOptions](./puppeteer.pdfoptions.md) | Valid options to configure PDF generation via [Page.pdf()](./puppeteer.page.pdf.md). |
| [Point](./puppeteer.point.md) | |
| [PuppeteerLaunchOptions](./puppeteer.puppeteerlaunchoptions.md) | |
| [RemoteAddress](./puppeteer.remoteaddress.md) | |
| [ResponseForRequest](./puppeteer.responseforrequest.md) | Required response data to fulfill a request with. |
| [ScreencastOptions](./puppeteer.screencastoptions.md) | |
| [ScreenshotClip](./puppeteer.screenshotclip.md) | |
| [ScreenshotOptions](./puppeteer.screenshotoptions.md) | |
| [SerializedAXNode](./puppeteer.serializedaxnode.md) | Represents a Node and the properties of it that are relevant to Accessibility. |
| [SnapshotOptions](./puppeteer.snapshotoptions.md) | |
| [TracingOptions](./puppeteer.tracingoptions.md) | |
| [Viewport](./puppeteer.viewport.md) | |
| [WaitForNetworkIdleOptions](./puppeteer.waitfornetworkidleoptions.md) | |
| [WaitForOptions](./puppeteer.waitforoptions.md) | |
| [WaitForSelectorOptions](./puppeteer.waitforselectoroptions.md) | |
| [WaitForTargetOptions](./puppeteer.waitfortargetoptions.md) | |
| [WaitTimeoutOptions](./puppeteer.waittimeoutoptions.md) | |
## Namespaces
| Namespace | Description |
| ------------------------------------------------- | --------------------------------------- |
| [CDPSessionEvent](./puppeteer.cdpsessionevent.md) | Events that the CDPSession class emits. |
## Variables
| Variable | Description |
| --------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| [DEFAULT_INTERCEPT_RESOLUTION_PRIORITY](./puppeteer.default_intercept_resolution_priority.md) | The default cooperative request interception resolution priority |
| [KnownDevices](./puppeteer.knowndevices.md) | A list of devices to be used with [Page.emulate()](./puppeteer.page.emulate.md). |
| [MouseButton](./puppeteer.mousebutton.md) | Enum of valid mouse buttons. |
| [PredefinedNetworkConditions](./puppeteer.predefinednetworkconditions.md) | A list of network conditions to be used with [Page.emulateNetworkConditions()](./puppeteer.page.emulatenetworkconditions.md). |
| [puppeteer](./puppeteer.puppeteer.md) | |
## Type Aliases
| Type Alias | Description |
| ----------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [ActionResult](./puppeteer.actionresult.md) | |
| [Awaitable](./puppeteer.awaitable.md) | |
| [AwaitableIterable](./puppeteer.awaitableiterable.md) | |
| [AwaitablePredicate](./puppeteer.awaitablepredicate.md) | |
| [AwaitedLocator](./puppeteer.awaitedlocator.md) | |
| [CDPEvents](./puppeteer.cdpevents.md) | |
| [ChromeReleaseChannel](./puppeteer.chromereleasechannel.md) | |
| [ConsoleMessageType](./puppeteer.consolemessagetype.md) | The supported types for console messages. |
| [CookiePriority](./puppeteer.cookiepriority.md) | Represents the cookie's 'Priority' status: https://tools.ietf.org/html/draft-west-cookie-priority-00 |
| [CookieSameSite](./puppeteer.cookiesamesite.md) | Represents the cookie's 'SameSite' status: https://tools.ietf.org/html/draft-west-first-party-cookies |
| [CookieSourceScheme](./puppeteer.cookiesourcescheme.md) | Represents the source scheme of the origin that originally set the cookie. A value of "Unset" allows protocol clients to emulate legacy cookie scope for the scheme. This is a temporary ability and it will be removed in the future. |
| [ElementFor](./puppeteer.elementfor.md) | |
| [ErrorCode](./puppeteer.errorcode.md) | |
| [EvaluateFunc](./puppeteer.evaluatefunc.md) | |
| [EvaluateFuncWith](./puppeteer.evaluatefuncwith.md) | |
| [EventsWithWildcard](./puppeteer.eventswithwildcard.md) | |
| [EventType](./puppeteer.eventtype.md) | |
| [ExperimentsConfiguration](./puppeteer.experimentsconfiguration.md) | <p>Defines experiment options for Puppeteer.</p><p>See individual properties for more information.</p> |
| [FlattenHandle](./puppeteer.flattenhandle.md) | |
| [HandleFor](./puppeteer.handlefor.md) | |
| [HandleOr](./puppeteer.handleor.md) | |
| [Handler](./puppeteer.handler.md) | |
| [InnerParams](./puppeteer.innerparams.md) | |
| [KeyInput](./puppeteer.keyinput.md) | All the valid keys that can be passed to functions that take user input, such as [keyboard.press](./puppeteer.keyboard.press.md) |
| [KeyPressOptions](./puppeteer.keypressoptions.md) | |
| [LocatorClickOptions](./puppeteer.locatorclickoptions.md) | |
| [LowerCasePaperFormat](./puppeteer.lowercasepaperformat.md) | |
| [Mapper](./puppeteer.mapper.md) | |
| [MouseButton](./puppeteer.mousebutton.md) | |
| [NodeFor](./puppeteer.nodefor.md) | |
| [PaperFormat](./puppeteer.paperformat.md) | All the valid paper format types when printing a PDF. |
| [Permission](./puppeteer.permission.md) | |
| [Predicate](./puppeteer.predicate.md) | |
| [Product](./puppeteer.product.md) | Supported products. |
| [ProtocolLifeCycleEvent](./puppeteer.protocollifecycleevent.md) | |
| [ProtocolType](./puppeteer.protocoltype.md) | |
| [PuppeteerLifeCycleEvent](./puppeteer.puppeteerlifecycleevent.md) | |
| [PuppeteerNodeLaunchOptions](./puppeteer.puppeteernodelaunchoptions.md) | Utility type exposed to enable users to define options that can be passed to <code>puppeteer.launch</code> without having to list the set of all types. |
| [Quad](./puppeteer.quad.md) | |
| [ResourceType](./puppeteer.resourcetype.md) | Resource types for HTTPRequests as perceived by the rendering engine. |
| [TargetFilterCallback](./puppeteer.targetfiltercallback.md) | |
| [VisibilityOption](./puppeteer.visibilityoption.md) | |

View File

@ -1,17 +0,0 @@
---
sidebar_label: ActionOptions
---
# ActionOptions interface
#### Signature:
```typescript
export interface ActionOptions
```
## Properties
| Property | Modifiers | Type | Description | Default |
| -------- | --------------------- | ----------- | ----------- | ------- |
| signal | <code>optional</code> | AbortSignal | | |

View File

@ -1,17 +0,0 @@
---
sidebar_label: AutofillData
---
# AutofillData interface
#### Signature:
```typescript
export interface AutofillData
```
## Properties
| Property | Modifiers | Type | Description | Default |
| ---------- | --------- | ------------------------------------------------------------------------------------------------- | ----------- | ------- |
| creditCard | | &#123; number: string; name: string; expiryMonth: string; expiryYear: string; cvc: string; &#125; | | |

View File

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

View File

@ -1,22 +0,0 @@
---
sidebar_label: BoxModel
---
# BoxModel interface
#### Signature:
```typescript
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 | | |

View File

@ -1,82 +0,0 @@
---
sidebar_label: Browser
---
# Browser class
[Browser](./puppeteer.browser.md) represents a browser instance that is either:
- connected to via [Puppeteer.connect()](./puppeteer.puppeteer.connect.md) or - launched by [PuppeteerNode.launch()](./puppeteer.puppeteernode.launch.md).
[Browser](./puppeteer.browser.md) [emits](./puppeteer.eventemitter.md) various events which are documented in the [BrowserEvent](./puppeteer.browserevent.md) enum.
#### Signature:
```typescript
export declare abstract class Browser extends EventEmitter<BrowserEvents>
```
**Extends:** [EventEmitter](./puppeteer.eventemitter.md)&lt;[BrowserEvents](./puppeteer.browserevents.md)&gt;
## Remarks
The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `Browser` class.
## Example 1
Using a [Browser](./puppeteer.browser.md) to create a [Page](./puppeteer.page.md):
```ts
import puppeteer from 'puppeteer';
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto('https://example.com');
await browser.close();
```
## Example 2
Disconnecting from and reconnecting to a [Browser](./puppeteer.browser.md):
```ts
import puppeteer from 'puppeteer';
const browser = await puppeteer.launch();
// Store the endpoint to be able to reconnect to the browser.
const browserWSEndpoint = browser.wsEndpoint();
// Disconnect puppeteer from the browser.
await browser.disconnect();
// Use the endpoint to reestablish a connection
const browser2 = await puppeteer.connect({browserWSEndpoint});
// Close the browser.
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. |
## 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>&quot;HeadlessChrome/61.0.3153.0&quot;</code>. For non-headless or new-headless, this is similar to <code>&quot;Chrome/61.0.3153.0&quot;</code>. For Firefox, it is similar to <code>&quot;Firefox/116.0a1&quot;</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> |

View File

@ -1,24 +0,0 @@
---
sidebar_label: BrowserConnectOptions
---
# BrowserConnectOptions interface
Generic browser options that can be passed when launching any browser or when connecting to an existing browser instance.
#### Signature:
```typescript
export interface BrowserConnectOptions
```
## Properties
| Property | Modifiers | Type | Description | Default |
| ----------------- | --------------------- | ----------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ------------------------------------- |
| defaultViewport | <code>optional</code> | [Viewport](./puppeteer.viewport.md) \| null | Sets the viewport for each page. | '&#123;width: 800, height: 600&#125;' |
| 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. | |

View File

@ -1,61 +0,0 @@
---
sidebar_label: BrowserContext
---
# BrowserContext class
[BrowserContext](./puppeteer.browsercontext.md) represents individual user contexts within a [browser](./puppeteer.browser.md).
When a [browser](./puppeteer.browser.md) is launched, it has a single [browser context](./puppeteer.browsercontext.md) by default. Others can be created using [Browser.createBrowserContext()](./puppeteer.browser.createbrowsercontext.md). Each context has isolated storage (cookies/localStorage/etc.)
[BrowserContext](./puppeteer.browsercontext.md) [emits](./puppeteer.eventemitter.md) various events which are documented in the [BrowserContextEvent](./puppeteer.browsercontextevent.md) enum.
If a [page](./puppeteer.page.md) opens another [page](./puppeteer.page.md), e.g. using `window.open`, the popup will belong to the parent [page's browser context](./puppeteer.page.browsercontext.md).
#### Signature:
```typescript
export declare abstract class BrowserContext extends EventEmitter<BrowserContextEvents>
```
**Extends:** [EventEmitter](./puppeteer.eventemitter.md)&lt;[BrowserContextEvents](./puppeteer.browsercontextevents.md)&gt;
## Remarks
The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `BrowserContext` class.
## Example
Creating a new [browser context](./puppeteer.browsercontext.md):
```ts
// Create a new browser context
const context = await browser.createBrowserContext();
// Create a new page inside context.
const page = await context.newPage();
// ... do stuff with page ...
await page.goto('https://example.com');
// Dispose context once it's no longer needed.
await context.close();
```
## 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). |
## 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> |

View File

@ -1,19 +0,0 @@
---
sidebar_label: BrowserContextEvent
---
# BrowserContextEvent enum
#### Signature:
```typescript
export declare const enum BrowserContextEvent
```
## Enumeration Members
| Member | Value | Description |
| --------------- | ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| TargetChanged | <code>&quot;targetchanged&quot;</code> | Emitted when the url of a target inside the browser context changes. Contains a [Target](./puppeteer.target.md) instance. |
| TargetCreated | <code>&quot;targetcreated&quot;</code> | <p>Emitted when a target is created within the browser context, for example when a new page is opened by [window.open](https://developer.mozilla.org/en-US/docs/Web/API/Window/open) or by [browserContext.newPage](./puppeteer.browsercontext.newpage.md)</p><p>Contains a [Target](./puppeteer.target.md) instance.</p> |
| TargetDestroyed | <code>&quot;targetdestroyed&quot;</code> | Emitted when a target is destroyed within the browser context, for example when a page is closed. Contains a [Target](./puppeteer.target.md) instance. |

View File

@ -1,21 +0,0 @@
---
sidebar_label: BrowserContextEvents
---
# BrowserContextEvents interface
#### Signature:
```typescript
export interface BrowserContextEvents extends Record<EventType, unknown>
```
**Extends:** Record&lt;[EventType](./puppeteer.eventtype.md), unknown&gt;
## Properties
| Property | Modifiers | Type | Description | Default |
| --------------- | --------- | ------------------------------- | ----------- | ------- |
| targetchanged | | [Target](./puppeteer.target.md) | | |
| targetcreated | | [Target](./puppeteer.target.md) | | |
| targetdestroyed | | [Target](./puppeteer.target.md) | | |

View File

@ -1,18 +0,0 @@
---
sidebar_label: BrowserContextOptions
---
# BrowserContextOptions interface
#### Signature:
```typescript
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>. | |

View File

@ -1,22 +0,0 @@
---
sidebar_label: BrowserEvent
---
# BrowserEvent enum
All the events a [browser instance](./puppeteer.browser.md) may emit.
#### Signature:
```typescript
export declare const enum BrowserEvent
```
## Enumeration Members
| Member | Value | Description |
| --------------- | ---------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Disconnected | <code>&quot;disconnected&quot;</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>&quot;targetchanged&quot;</code> | Emitted when the URL of a target changes. Contains a [Target](./puppeteer.target.md) instance. |
| TargetCreated | <code>&quot;targetcreated&quot;</code> | <p>Emitted when a target is created, for example when a new page is opened by [window.open](https://developer.mozilla.org/en-US/docs/Web/API/Window/open) or by [browser.newPage](./puppeteer.browser.newpage.md)</p><p>Contains a [Target](./puppeteer.target.md) instance.</p> |
| TargetDestroyed | <code>&quot;targetdestroyed&quot;</code> | Emitted when a target is destroyed, for example when a page is closed. Contains a [Target](./puppeteer.target.md) instance. |

View File

@ -1,22 +0,0 @@
---
sidebar_label: BrowserEvents
---
# BrowserEvents interface
#### Signature:
```typescript
export interface BrowserEvents extends Record<EventType, unknown>
```
**Extends:** Record&lt;[EventType](./puppeteer.eventtype.md), unknown&gt;
## Properties
| Property | Modifiers | Type | Description | Default |
| --------------- | --------- | ------------------------------- | ----------- | ------- |
| disconnected | | undefined | | |
| targetchanged | | [Target](./puppeteer.target.md) | | |
| targetcreated | | [Target](./puppeteer.target.md) | | |
| targetdestroyed | | [Target](./puppeteer.target.md) | | |

View File

@ -1,23 +0,0 @@
---
sidebar_label: BrowserLaunchArgumentOptions
---
# BrowserLaunchArgumentOptions interface
Launcher options that only apply to Chrome.
#### Signature:
```typescript
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. | |

View File

@ -1,20 +0,0 @@
---
sidebar_label: CDPSessionEvent
---
# CDPSessionEvent namespace
Events that the CDPSession class emits.
#### Signature:
```typescript
export declare namespace CDPSessionEvent
```
## Variables
| Variable | Description |
| ----------------------------------------------------------------- | ----------- |
| [SessionAttached](./puppeteer.cdpsessionevent.sessionattached.md) | |
| [SessionDetached](./puppeteer.cdpsessionevent.sessiondetached.md) | |

View File

@ -1,20 +0,0 @@
---
sidebar_label: CDPSessionEvents
---
# CDPSessionEvents interface
#### Signature:
```typescript
export interface CDPSessionEvents extends CDPEvents, Record<EventType, unknown>
```
**Extends:** [CDPEvents](./puppeteer.cdpevents.md), Record&lt;[EventType](./puppeteer.eventtype.md), unknown&gt;
## Properties
| Property | Modifiers | Type | Description | Default |
| --------------- | --------- | --------------------------------------- | ----------- | ------- |
| sessionattached | | [CDPSession](./puppeteer.cdpsession.md) | | |
| sessiondetached | | [CDPSession](./puppeteer.cdpsession.md) | | |

View File

@ -1,19 +0,0 @@
---
sidebar_label: ClickOptions
---
# ClickOptions interface
#### Signature:
```typescript
export interface ClickOptions extends MouseClickOptions
```
**Extends:** [MouseClickOptions](./puppeteer.mouseclickoptions.md)
## 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. | |

View File

@ -1,17 +0,0 @@
---
sidebar_label: CommandOptions
---
# CommandOptions interface
#### Signature:
```typescript
export interface CommandOptions
```
## Properties
| Property | Modifiers | Type | Description | Default |
| -------- | --------- | ------ | ----------- | ------- |
| timeout | | number | | |

View File

@ -1,22 +0,0 @@
---
sidebar_label: CommonEventEmitter
---
# CommonEventEmitter interface
#### Signature:
```typescript
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) | |

View File

@ -1,27 +0,0 @@
---
sidebar_label: CommonEventEmitter.off
---
# CommonEventEmitter.off() method
#### Signature:
```typescript
interface CommonEventEmitter {
off<Key extends keyof Events>(
type: Key,
handler?: Handler<Events[Key]>
): this;
}
```
## Parameters
| Parameter | Type | Description |
| --------- | ------------------------------------------------------ | ------------ |
| type | Key | |
| handler | [Handler](./puppeteer.handler.md)&lt;Events\[Key\]&gt; | _(Optional)_ |
**Returns:**
this

View File

@ -1,24 +0,0 @@
---
sidebar_label: CommonEventEmitter.on
---
# CommonEventEmitter.on() method
#### Signature:
```typescript
interface CommonEventEmitter {
on<Key extends keyof Events>(type: Key, handler: Handler<Events[Key]>): this;
}
```
## Parameters
| Parameter | Type | Description |
| --------- | ------------------------------------------------------ | ----------- |
| type | Key | |
| handler | [Handler](./puppeteer.handler.md)&lt;Events\[Key\]&gt; | |
**Returns:**
this

View File

@ -1,27 +0,0 @@
---
sidebar_label: CommonEventEmitter.once
---
# CommonEventEmitter.once() method
#### Signature:
```typescript
interface CommonEventEmitter {
once<Key extends keyof Events>(
type: Key,
handler: Handler<Events[Key]>
): this;
}
```
## Parameters
| Parameter | Type | Description |
| --------- | ------------------------------------------------------ | ----------- |
| type | Key | |
| handler | [Handler](./puppeteer.handler.md)&lt;Events\[Key\]&gt; | |
**Returns:**
this

View File

@ -1,31 +0,0 @@
---
sidebar_label: Configuration
---
# Configuration interface
Defines options to configure Puppeteer's behavior during installation and runtime.
See individual properties for more information.
#### Signature:
```typescript
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> |

View File

@ -1,23 +0,0 @@
---
sidebar_label: connect
---
# connect() function
#### Signature:
```typescript
connect: (
options: import('puppeteer-core/internal/puppeteer-core.js').ConnectOptions
) => Promise<import('puppeteer-core/internal/puppeteer-core.js').Browser>;
```
## Parameters
| Parameter | Type | Description |
| --------- | --------------------------------------------------------------------------------------------------- | ----------- |
| options | import("puppeteer-core/internal/puppeteer-core.js").[ConnectOptions](./puppeteer.connectoptions.md) | |
**Returns:**
Promise&lt;import("puppeteer-core/internal/puppeteer-core.js").[Browser](./puppeteer.browser.md)&gt;

View File

@ -1,29 +0,0 @@
---
sidebar_label: Connection.(constructor)
---
# Connection.(constructor)
Constructs a new instance of the `Connection` class
#### Signature:
```typescript
class Connection {
constructor(
url: string,
transport: ConnectionTransport,
delay?: number,
timeout?: number
);
}
```
## Parameters
| Parameter | Type | Description |
| --------- | --------------------------------------------------------- | ------------ |
| url | string | |
| transport | [ConnectionTransport](./puppeteer.connectiontransport.md) | |
| delay | number | _(Optional)_ |
| timeout | number | _(Optional)_ |

View File

@ -1,36 +0,0 @@
---
sidebar_label: Connection
---
# Connection class
#### Signature:
```typescript
export declare class Connection extends EventEmitter<CDPSessionEvents>
```
**Extends:** [EventEmitter](./puppeteer.eventemitter.md)&lt;[CDPSessionEvents](./puppeteer.cdpsessionevents.md)&gt;
## Constructors
| Constructor | Modifiers | Description |
| ---------------------------------------------------------------------------------------- | --------- | -------------------------------------------------------------- |
| [(constructor)(url, transport, delay, timeout)](./puppeteer.connection._constructor_.md) | | Constructs a new instance of the <code>Connection</code> class |
## Properties
| Property | Modifiers | Type | Description |
| -------- | --------------------- | ------ | ----------- |
| timeout | <code>readonly</code> | number | |
## 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) | | |

View File

@ -1,25 +0,0 @@
---
sidebar_label: ConnectionTransport
---
# ConnectionTransport interface
#### Signature:
```typescript
export interface ConnectionTransport
```
## Properties
| Property | Modifiers | Type | Description | Default |
| --------- | --------------------- | ---------------------------- | ----------- | ------- |
| onclose | <code>optional</code> | () =&gt; void | | |
| onmessage | <code>optional</code> | (message: string) =&gt; void | | |
## Methods
| Method | Description |
| -------------------------------------------------------- | ----------- |
| [close()](./puppeteer.connectiontransport.close.md) | |
| [send(message)](./puppeteer.connectiontransport.send.md) | |

View File

@ -1,22 +0,0 @@
---
sidebar_label: ConnectOptions
---
# ConnectOptions interface
#### Signature:
```typescript
export interface ConnectOptions extends BrowserConnectOptions
```
**Extends:** [BrowserConnectOptions](./puppeteer.browserconnectoptions.md)
## Properties
| Property | Modifiers | Type | Description | Default |
| ----------------- | --------------------- | --------------------------------------------------------- | --------------------------------------------- | ------- |
| browserURL | <code>optional</code> | string | | |
| browserWSEndpoint | <code>optional</code> | string | | |
| headers | <code>optional</code> | Record&lt;string, string&gt; | Headers to use for the web socket connection. | |
| transport | <code>optional</code> | [ConnectionTransport](./puppeteer.connectiontransport.md) | | |

View File

@ -1,29 +0,0 @@
---
sidebar_label: ConsoleMessage.(constructor)
---
# ConsoleMessage.(constructor)
Constructs a new instance of the `ConsoleMessage` class
#### Signature:
```typescript
class ConsoleMessage {
constructor(
type: ConsoleMessageType,
text: string,
args: JSHandle[],
stackTraceLocations: ConsoleMessageLocation[]
);
}
```
## Parameters
| Parameter | Type | Description |
| ------------------- | ------------------------------------------------------------------- | ----------- |
| type | [ConsoleMessageType](./puppeteer.consolemessagetype.md) | |
| text | string | |
| args | [JSHandle](./puppeteer.jshandle.md)\[\] | |
| stackTraceLocations | [ConsoleMessageLocation](./puppeteer.consolemessagelocation.md)\[\] | |

View File

@ -1,29 +0,0 @@
---
sidebar_label: ConsoleMessage
---
# ConsoleMessage class
ConsoleMessage objects are dispatched by page via the 'console' event.
#### Signature:
```typescript
export declare class ConsoleMessage
```
## Constructors
| Constructor | Modifiers | Description |
| --------------------------------------------------------------------------------------------------- | --------- | ------------------------------------------------------------------ |
| [(constructor)(type, text, args, stackTraceLocations)](./puppeteer.consolemessage._constructor_.md) | | Constructs a new instance of the <code>ConsoleMessage</code> class |
## Methods
| Method | Modifiers | Description |
| -------------------------------------------------------- | --------- | ----------------------------------------------------------- |
| [args()](./puppeteer.consolemessage.args.md) | | 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

@ -1,19 +0,0 @@
---
sidebar_label: ConsoleMessageLocation
---
# ConsoleMessageLocation interface
#### Signature:
```typescript
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. | |

View File

@ -1,20 +0,0 @@
---
sidebar_label: ContinueRequestOverrides
---
# ContinueRequestOverrides interface
#### Signature:
```typescript
export interface ContinueRequestOverrides
```
## Properties
| Property | Modifiers | Type | Description | Default |
| -------- | --------------------- | ---------------------------- | ------------------------------------------------------------ | ------- |
| headers | <code>optional</code> | Record&lt;string, string&gt; | | |
| 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. | |

View File

@ -1,33 +0,0 @@
---
sidebar_label: Cookie
---
# Cookie interface
Represents a cookie object.
#### Signature:
```typescript
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. | |

View File

@ -1,31 +0,0 @@
---
sidebar_label: CookieParam
---
# CookieParam interface
Cookie parameter object
#### Signature:
```typescript
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. | |

View File

@ -1,59 +0,0 @@
---
sidebar_label: Coverage
---
# Coverage class
The Coverage class provides methods to gather information about parts of JavaScript and CSS that were used by the page.
#### Signature:
```typescript
export declare class Coverage
```
## Remarks
To output coverage in a form consumable by [Istanbul](https://github.com/istanbuljs), see [puppeteer-to-istanbul](https://github.com/istanbuljs/puppeteer-to-istanbul).
## Example
An example of using JavaScript and CSS coverage to get percentage of initially executed code:
```ts
// Enable both JavaScript and CSS coverage
await Promise.all([
page.coverage.startJSCoverage(),
page.coverage.startCSSCoverage(),
]);
// Navigate to page
await page.goto('https://example.com');
// Disable both JavaScript and CSS coverage
const [jsCoverage, cssCoverage] = await Promise.all([
page.coverage.stopJSCoverage(),
page.coverage.stopCSSCoverage(),
]);
let totalBytes = 0;
let usedBytes = 0;
const coverage = [...jsCoverage, ...cssCoverage];
for (const entry of coverage) {
totalBytes += entry.text.length;
for (const range of entry.ranges) usedBytes += range.end - range.start - 1;
}
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 |
## 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. |

View File

@ -1,25 +0,0 @@
---
sidebar_label: Coverage.startCSSCoverage
---
# Coverage.startCSSCoverage() method
#### Signature:
```typescript
class Coverage {
startCSSCoverage(options?: CSSCoverageOptions): Promise<void>;
}
```
## Parameters
| Parameter | Type | Description |
| --------- | ------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
| options | [CSSCoverageOptions](./puppeteer.csscoverageoptions.md) | _(Optional)_ Set of configurable options for coverage, defaults to <code>resetOnNavigation : true</code> |
**Returns:**
Promise&lt;void&gt;
Promise that resolves when coverage is started.

View File

@ -1,29 +0,0 @@
---
sidebar_label: Coverage.startJSCoverage
---
# Coverage.startJSCoverage() method
#### Signature:
```typescript
class Coverage {
startJSCoverage(options?: JSCoverageOptions): Promise<void>;
}
```
## 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> |
**Returns:**
Promise&lt;void&gt;
Promise that resolves when coverage is started.
## Remarks
Anonymous scripts are ones that don't have an associated url. These are scripts that are dynamically created on the page using `eval` or `new Function`. If `reportAnonymousScripts` is set to `true`, anonymous scripts URL will start with `debugger://VM` (unless a magic //\# sourceURL comment is present, in which case that will the be URL).

View File

@ -1,21 +0,0 @@
---
sidebar_label: CoverageEntry
---
# CoverageEntry interface
The CoverageEntry class represents one entry of the coverage report.
#### Signature:
```typescript
export interface CoverageEntry
```
## Properties
| Property | Modifiers | Type | Description | Default |
| -------- | --------- | ------------------------------------------------------ | --------------------------------------------- | ------- |
| ranges | | Array&lt;&#123; start: number; end: number; &#125;&gt; | 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. | |

View File

@ -1,18 +0,0 @@
---
sidebar_label: Credentials
---
# Credentials interface
#### Signature:
```typescript
export interface Credentials
```
## Properties
| Property | Modifiers | Type | Description | Default |
| -------- | --------- | ------ | ----------- | ------- |
| password | | string | | |
| username | | string | | |

View File

@ -1,24 +0,0 @@
---
sidebar_label: CSSCoverage
---
# CSSCoverage class
#### Signature:
```typescript
export declare class CSSCoverage
```
## Constructors
| Constructor | Modifiers | Description |
| ----------------------------------------------------------------- | --------- | --------------------------------------------------------------- |
| [(constructor)(client)](./puppeteer.csscoverage._constructor_.md) | | Constructs a new instance of the <code>CSSCoverage</code> class |
## Methods
| Method | Modifiers | Description |
| -------------------------------------------------- | --------- | ----------- |
| [start(options)](./puppeteer.csscoverage.start.md) | | |
| [stop()](./puppeteer.csscoverage.stop.md) | | |

View File

@ -1,19 +0,0 @@
---
sidebar_label: CSSCoverageOptions
---
# CSSCoverageOptions interface
Set of configurable options for CSS coverage.
#### Signature:
```typescript
export interface CSSCoverageOptions
```
## Properties
| Property | Modifiers | Type | Description | Default |
| ----------------- | --------------------- | ------- | ---------------------------------------------- | ------- |
| resetOnNavigation | <code>optional</code> | boolean | Whether to reset coverage on every navigation. | |

View File

@ -1,18 +0,0 @@
---
sidebar_label: CustomQueryHandler
---
# CustomQueryHandler interface
#### Signature:
```typescript
export interface CustomQueryHandler
```
## Properties
| 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

@ -1,17 +0,0 @@
---
sidebar_label: DebugInfo
---
# DebugInfo interface
#### Signature:
```typescript
export interface DebugInfo
```
## Properties
| Property | Modifiers | Type | Description | Default |
| --------------------- | --------- | --------- | ----------- | ------- |
| pendingProtocolErrors | | Error\[\] | | |

View File

@ -1,21 +0,0 @@
---
sidebar_label: defaultArgs
---
# defaultArgs() function
#### Signature:
```typescript
defaultArgs: (options?: import("puppeteer-core/internal/puppeteer-core.js").BrowserLaunchArgumentOptions | undefined) => string[]
```
## Parameters
| Parameter | Type | Description |
| --------- | -------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
| options | import("puppeteer-core/internal/puppeteer-core.js").[BrowserLaunchArgumentOptions](./puppeteer.browserlaunchargumentoptions.md) \| undefined | _(Optional)_ |
**Returns:**
string\[\]

View File

@ -1,20 +0,0 @@
---
sidebar_label: DeleteCookiesRequest
---
# DeleteCookiesRequest interface
#### Signature:
```typescript
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. | |

View File

@ -1,18 +0,0 @@
---
sidebar_label: Device
---
# Device interface
#### Signature:
```typescript
export interface Device
```
## Properties
| Property | Modifiers | Type | Description | Default |
| --------- | --------- | ----------------------------------- | ----------- | ------- |
| userAgent | | string | | |
| viewport | | [Viewport](./puppeteer.viewport.md) | | |

View File

@ -1,45 +0,0 @@
---
sidebar_label: DeviceRequestPrompt
---
# DeviceRequestPrompt class
Device request prompts let you respond to the page requesting for a device through an API like WebBluetooth.
#### Signature:
```typescript
export declare class DeviceRequestPrompt
```
## Remarks
`DeviceRequestPrompt` instances are returned via the [Page.waitForDevicePrompt()](./puppeteer.page.waitfordeviceprompt.md) method.
The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `DeviceRequestPrompt` class.
## Example
```ts
const [deviceRequest] = Promise.all([
page.waitForDevicePrompt(),
page.click('#connect-bluetooth'),
]);
await devicePrompt.select(
await devicePrompt.waitForDevice(({name}) => name.includes('My Device'))
);
```
## Properties
| Property | Modifiers | Type | Description |
| -------- | --------- | ------------------------------------------------------------------------- | ----------------------------------- |
| devices | | [DeviceRequestPromptDevice](./puppeteer.devicerequestpromptdevice.md)\[\] | Current list of selectable devices. |
## 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. |

View File

@ -1,29 +0,0 @@
---
sidebar_label: DeviceRequestPrompt.waitForDevice
---
# DeviceRequestPrompt.waitForDevice() method
Resolve to the first device in the prompt matching a filter.
#### Signature:
```typescript
class DeviceRequestPrompt {
waitForDevice(
filter: (device: DeviceRequestPromptDevice) => boolean,
options?: WaitTimeoutOptions
): Promise<DeviceRequestPromptDevice>;
}
```
## Parameters
| Parameter | Type | Description |
| --------- | --------------------------------------------------------------------------------------------- | ------------ |
| filter | (device: [DeviceRequestPromptDevice](./puppeteer.devicerequestpromptdevice.md)) =&gt; boolean | |
| options | [WaitTimeoutOptions](./puppeteer.waittimeoutoptions.md) | _(Optional)_ |
**Returns:**
Promise&lt;[DeviceRequestPromptDevice](./puppeteer.devicerequestpromptdevice.md)&gt;

View File

@ -1,25 +0,0 @@
---
sidebar_label: Dialog.accept
---
# Dialog.accept() method
A promise that resolves when the dialog has been accepted.
#### Signature:
```typescript
class Dialog {
accept(promptText?: string): Promise<void>;
}
```
## 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>. |
**Returns:**
Promise&lt;void&gt;

View File

@ -1,44 +0,0 @@
---
sidebar_label: Dialog
---
# Dialog class
Dialog instances are dispatched by the [Page](./puppeteer.page.md) via the `dialog` event.
#### Signature:
```typescript
export declare abstract class Dialog
```
## Remarks
The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `Dialog` class.
## Example
```ts
import puppeteer from 'puppeteer';
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
page.on('dialog', async dialog => {
console.log(dialog.message());
await dialog.dismiss();
await browser.close();
});
page.evaluate(() => alert('1'));
})();
```
## 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. |

View File

@ -1,31 +0,0 @@
---
sidebar_label: ElementHandle.drag
---
# ElementHandle.drag() method
Drags an element over the given element or point.
#### Signature:
```typescript
class ElementHandle {
drag(
this: ElementHandle<Element>,
target: Point | ElementHandle<Element>
): Promise<Protocol.Input.DragData | void>;
}
```
## Parameters
| Parameter | Type | Description |
| --------- | --------------------------------------------------------------------------------------------- | ----------- |
| this | [ElementHandle](./puppeteer.elementhandle.md)&lt;Element&gt; | |
| target | [Point](./puppeteer.point.md) \| [ElementHandle](./puppeteer.elementhandle.md)&lt;Element&gt; | |
**Returns:**
Promise&lt;Protocol.Input.DragData \| void&gt;
DEPRECATED. When drag interception is enabled, the drag payload is returned.

View File

@ -1,35 +0,0 @@
---
sidebar_label: ElementHandle.dragAndDrop
---
# ElementHandle.dragAndDrop() method
> Warning: This API is now obsolete.
>
> Use `ElementHandle.drop` instead.
#### Signature:
```typescript
class ElementHandle {
dragAndDrop(
this: ElementHandle<Element>,
target: ElementHandle<Node>,
options?: {
delay: number;
}
): Promise<void>;
}
```
## Parameters
| Parameter | Type | Description |
| --------- | ------------------------------------------------------------ | ------------ |
| this | [ElementHandle](./puppeteer.elementhandle.md)&lt;Element&gt; | |
| target | [ElementHandle](./puppeteer.elementhandle.md)&lt;Node&gt; | |
| options | &#123; delay: number; &#125; | _(Optional)_ |
**Returns:**
Promise&lt;void&gt;

View File

@ -1,29 +0,0 @@
---
sidebar_label: ElementHandle.drop
---
# ElementHandle.drop() method
Drops the given element onto the current one.
#### Signature:
```typescript
class ElementHandle {
drop(
this: ElementHandle<Element>,
element: ElementHandle<Element>
): Promise<void>;
}
```
## Parameters
| Parameter | Type | Description |
| --------- | ------------------------------------------------------------ | ----------- |
| this | [ElementHandle](./puppeteer.elementhandle.md)&lt;Element&gt; | |
| element | [ElementHandle](./puppeteer.elementhandle.md)&lt;Element&gt; | |
**Returns:**
Promise&lt;void&gt;

View File

@ -1,31 +0,0 @@
---
sidebar_label: ElementHandle.drop_1
---
# ElementHandle.drop() method
> Warning: This API is now obsolete.
>
> No longer supported.
#### Signature:
```typescript
class ElementHandle {
drop(
this: ElementHandle<Element>,
data?: Protocol.Input.DragData
): Promise<void>;
}
```
## Parameters
| Parameter | Type | Description |
| --------- | ------------------------------------------------------------ | ------------ |
| this | [ElementHandle](./puppeteer.elementhandle.md)&lt;Element&gt; | |
| data | Protocol.Input.DragData | _(Optional)_ |
**Returns:**
Promise&lt;void&gt;

View File

@ -1,31 +0,0 @@
---
sidebar_label: ElementHandle.isIntersectingViewport
---
# ElementHandle.isIntersectingViewport() method
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.
#### Signature:
```typescript
class ElementHandle {
isIntersectingViewport(
this: ElementHandle<Element>,
options?: {
threshold?: number;
}
): Promise<boolean>;
}
```
## Parameters
| Parameter | Type | Description |
| --------- | ------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------- |
| this | [ElementHandle](./puppeteer.elementhandle.md)&lt;Element&gt; | |
| options | &#123; threshold?: number; &#125; | _(Optional)_ Threshold for the intersection between 0 (no intersection) and 1 (full intersection). Defaults to 1. |
**Returns:**
Promise&lt;boolean&gt;

View File

@ -1,86 +0,0 @@
---
sidebar_label: ElementHandle
---
# ElementHandle class
ElementHandle represents an in-page DOM element.
#### Signature:
```typescript
export declare abstract class ElementHandle<ElementType extends Node = Element> extends JSHandle<ElementType>
```
**Extends:** [JSHandle](./puppeteer.jshandle.md)&lt;ElementType&gt;
## Remarks
ElementHandles can be created with the [Page.$()](./puppeteer.page._.md) method.
```ts
import puppeteer from 'puppeteer';
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto('https://example.com');
const hrefElement = await page.$('a');
await hrefElement.click();
// ...
})();
```
ElementHandle prevents the DOM element from being garbage-collected unless the handle is [disposed](./puppeteer.jshandle.dispose.md). ElementHandles are auto-disposed when their origin frame gets navigated.
ElementHandle instances can be used as arguments in [Page.$eval()](./puppeteer.page._eval.md) and [Page.evaluate()](./puppeteer.page.evaluate.md) methods.
If you're using TypeScript, ElementHandle takes a generic argument that denotes the type of element the handle is holding within. For example, if you have a handle to a `<select>` element, you can type it as `ElementHandle<HTMLSelectElement>` and you get some nicer type checks.
The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `ElementHandle` class.
## Properties
| Property | Modifiers | Type | Description |
| -------- | --------------------- | ----------------------------- | ------------------------------------------ |
| frame | <code>readonly</code> | [Frame](./puppeteer.frame.md) | Frame corresponding to the current handle. |
## 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>&lt;select&gt;</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> |

View File

@ -1,32 +0,0 @@
---
sidebar_label: ElementHandle.press
---
# ElementHandle.press() method
Focuses the element, and then uses [Keyboard.down()](./puppeteer.keyboard.down.md) and [Keyboard.up()](./puppeteer.keyboard.up.md).
#### Signature:
```typescript
class ElementHandle {
press(key: KeyInput, options?: Readonly<KeyPressOptions>): Promise<void>;
}
```
## 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&lt;[KeyPressOptions](./puppeteer.keypressoptions.md)&gt; | _(Optional)_ |
**Returns:**
Promise&lt;void&gt;
## Remarks
If `key` is a single character and no modifier keys besides `Shift` are being held down, a `keypress`/`input` event will also be generated. The `text` option can be specified to force an input event to be generated.
**NOTE** Modifier keys DO affect `elementHandle.press`. Holding down `Shift` will type the text in upper case.

View File

@ -1,23 +0,0 @@
---
sidebar_label: ElementHandle.screenshot_1
---
# ElementHandle.screenshot() method
#### Signature:
```typescript
class ElementHandle {
screenshot(options?: Readonly<ScreenshotOptions>): Promise<Buffer>;
}
```
## Parameters
| Parameter | Type | Description |
| --------- | --------------------------------------------------------------------- | ------------ |
| options | Readonly&lt;[ScreenshotOptions](./puppeteer.screenshotoptions.md)&gt; | _(Optional)_ |
**Returns:**
Promise&lt;Buffer&gt;

View File

@ -1,32 +0,0 @@
---
sidebar_label: ElementHandle.select
---
# ElementHandle.select() method
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.
#### Signature:
```typescript
class ElementHandle {
select(...values: string[]): Promise<string[]>;
}
```
## Parameters
| Parameter | Type | Description |
| --------- | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| values | string\[\] | Values of options to select. If the <code>&lt;select&gt;</code> has the <code>multiple</code> attribute, all values are considered, otherwise only the first one is taken into account. |
**Returns:**
Promise&lt;string\[\]&gt;
## Example
```ts
handle.select('blue'); // single selection
handle.select('red', 'green', 'blue'); // multiple selections
```

View File

@ -1,23 +0,0 @@
---
sidebar_label: ElementHandle.touchEnd
---
# ElementHandle.touchEnd() method
#### Signature:
```typescript
class ElementHandle {
touchEnd(this: ElementHandle<Element>): Promise<void>;
}
```
## Parameters
| Parameter | Type | Description |
| --------- | ------------------------------------------------------------ | ----------- |
| this | [ElementHandle](./puppeteer.elementhandle.md)&lt;Element&gt; | |
**Returns:**
Promise&lt;void&gt;

View File

@ -1,23 +0,0 @@
---
sidebar_label: ElementHandle.touchMove
---
# ElementHandle.touchMove() method
#### Signature:
```typescript
class ElementHandle {
touchMove(this: ElementHandle<Element>): Promise<void>;
}
```
## Parameters
| Parameter | Type | Description |
| --------- | ------------------------------------------------------------ | ----------- |
| this | [ElementHandle](./puppeteer.elementhandle.md)&lt;Element&gt; | |
**Returns:**
Promise&lt;void&gt;

View File

@ -1,23 +0,0 @@
---
sidebar_label: ElementHandle.touchStart
---
# ElementHandle.touchStart() method
#### Signature:
```typescript
class ElementHandle {
touchStart(this: ElementHandle<Element>): Promise<void>;
}
```
## Parameters
| Parameter | Type | Description |
| --------- | ------------------------------------------------------------ | ----------- |
| this | [ElementHandle](./puppeteer.elementhandle.md)&lt;Element&gt; | |
**Returns:**
Promise&lt;void&gt;

View File

@ -1,31 +0,0 @@
---
sidebar_label: EventEmitter.emit
---
# EventEmitter.emit() method
Emit an event and call any associated listeners.
#### Signature:
```typescript
class EventEmitter {
emit<Key extends keyof EventsWithWildcard<Events>>(
type: Key,
event: EventsWithWildcard<Events>[Key]
): boolean;
}
```
## Parameters
| Parameter | Type | Description |
| --------- | ---------------------------------------------------------------------------- | ---------------------------- |
| type | Key | the event you'd like to emit |
| event | [EventsWithWildcard](./puppeteer.eventswithwildcard.md)&lt;Events&gt;\[Key\] | |
**Returns:**
boolean
`true` if there are any listeners, `false` if there are not.

View File

@ -1,27 +0,0 @@
---
sidebar_label: EventEmitter.listenerCount
---
# EventEmitter.listenerCount() method
Gets the number of listeners for a given event.
#### Signature:
```typescript
class EventEmitter {
listenerCount(type: keyof EventsWithWildcard<Events>): number;
}
```
## Parameters
| Parameter | Type | Description |
| --------- | --------------------------------------------------------------------------- | --------------------------------------- |
| type | keyof [EventsWithWildcard](./puppeteer.eventswithwildcard.md)&lt;Events&gt; | the event to get the listener count for |
**Returns:**
number
the number of listeners bound to the given event

View File

@ -1,32 +0,0 @@
---
sidebar_label: EventEmitter
---
# EventEmitter class
The EventEmitter class that many Puppeteer classes extend.
#### Signature:
```typescript
export declare class EventEmitter<Events extends Record<EventType, unknown>> implements CommonEventEmitter<EventsWithWildcard<Events>>
```
**Implements:** [CommonEventEmitter](./puppeteer.commoneventemitter.md)&lt;[EventsWithWildcard](./puppeteer.eventswithwildcard.md)&lt;Events&gt;&gt;
## Remarks
This allows you to listen to events that Puppeteer classes fire and act accordingly. Therefore you'll mostly use [on](./puppeteer.eventemitter.on.md) and [off](./puppeteer.eventemitter.off.md) to bind and unbind to event listeners.
The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `EventEmitter` class.
## Methods
| Method | Modifiers | Description |
| -------------------------------------------------------------------------- | --------- | ------------------------------------------------------------------------------------------------ |
| [emit(type, event)](./puppeteer.eventemitter.emit.md) | | Emit an event and call any associated listeners. |
| [listenerCount(type)](./puppeteer.eventemitter.listenercount.md) | | Gets the number of listeners for a given event. |
| [off(type, handler)](./puppeteer.eventemitter.off.md) | | Remove an event listener from firing. |
| [on(type, handler)](./puppeteer.eventemitter.on.md) | | Bind an event listener to fire when an event occurs. |
| [once(type, handler)](./puppeteer.eventemitter.once.md) | | Like <code>on</code> but the listener will only be fired once and then it will be removed. |
| [removeAllListeners(type)](./puppeteer.eventemitter.removealllisteners.md) | | Removes all listeners. If given an event argument, it will remove only listeners for that event. |

View File

@ -1,31 +0,0 @@
---
sidebar_label: EventEmitter.off
---
# EventEmitter.off() method
Remove an event listener from firing.
#### Signature:
```typescript
class EventEmitter {
off<Key extends keyof EventsWithWildcard<Events>>(
type: Key,
handler?: Handler<EventsWithWildcard<Events>[Key]>
): this;
}
```
## Parameters
| Parameter | Type | Description |
| --------- | --------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------- |
| type | Key | the event type you'd like to stop listening to. |
| handler | [Handler](./puppeteer.handler.md)&lt;[EventsWithWildcard](./puppeteer.eventswithwildcard.md)&lt;Events&gt;\[Key\]&gt; | _(Optional)_ the function that should be removed. |
**Returns:**
this
`this` to enable you to chain method calls.

View File

@ -1,31 +0,0 @@
---
sidebar_label: EventEmitter.on
---
# EventEmitter.on() method
Bind an event listener to fire when an event occurs.
#### Signature:
```typescript
class EventEmitter {
on<Key extends keyof EventsWithWildcard<Events>>(
type: Key,
handler: Handler<EventsWithWildcard<Events>[Key]>
): this;
}
```
## Parameters
| Parameter | Type | Description |
| --------- | --------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ |
| type | Key | the event type you'd like to listen to. Can be a string or symbol. |
| handler | [Handler](./puppeteer.handler.md)&lt;[EventsWithWildcard](./puppeteer.eventswithwildcard.md)&lt;Events&gt;\[Key\]&gt; | the function to be called when the event occurs. |
**Returns:**
this
`this` to enable you to chain method calls.

View File

@ -1,31 +0,0 @@
---
sidebar_label: EventEmitter.once
---
# EventEmitter.once() method
Like `on` but the listener will only be fired once and then it will be removed.
#### Signature:
```typescript
class EventEmitter {
once<Key extends keyof EventsWithWildcard<Events>>(
type: Key,
handler: Handler<EventsWithWildcard<Events>[Key]>
): this;
}
```
## Parameters
| Parameter | Type | Description |
| --------- | --------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------- |
| type | Key | the event you'd like to listen to |
| handler | [Handler](./puppeteer.handler.md)&lt;[EventsWithWildcard](./puppeteer.eventswithwildcard.md)&lt;Events&gt;\[Key\]&gt; | the handler function to run when the event occurs |
**Returns:**
this
`this` to enable you to chain method calls.

View File

@ -1,27 +0,0 @@
---
sidebar_label: EventEmitter.removeAllListeners
---
# EventEmitter.removeAllListeners() method
Removes all listeners. If given an event argument, it will remove only listeners for that event.
#### Signature:
```typescript
class EventEmitter {
removeAllListeners(type?: keyof EventsWithWildcard<Events>): this;
}
```
## Parameters
| Parameter | Type | Description |
| --------- | --------------------------------------------------------------------------- | ----------------------------------------------- |
| type | keyof [EventsWithWildcard](./puppeteer.eventswithwildcard.md)&lt;Events&gt; | _(Optional)_ the event to remove listeners for. |
**Returns:**
this
`this` to enable you to chain method calls.

View File

@ -1,25 +0,0 @@
---
sidebar_label: executablePath
---
# executablePath() function
#### Signature:
```typescript
executablePath: (
channel?:
| import('puppeteer-core/internal/puppeteer-core.js').ChromeReleaseChannel
| undefined
) => string;
```
## Parameters
| Parameter | Type | Description |
| --------- | ---------------------------------------------------------------------------------------------------------------------------- | ------------ |
| channel | import("puppeteer-core/internal/puppeteer-core.js").[ChromeReleaseChannel](./puppeteer.chromereleasechannel.md) \| undefined | _(Optional)_ |
**Returns:**
string

View File

@ -1,39 +0,0 @@
---
sidebar_label: FileChooser
---
# FileChooser class
File choosers let you react to the page requesting for a file.
#### Signature:
```typescript
export declare class FileChooser
```
## Remarks
`FileChooser` instances are returned via the [Page.waitForFileChooser()](./puppeteer.page.waitforfilechooser.md) method.
In browsers, only one file chooser can be opened at a time. All file choosers must be accepted or canceled. Not doing so will prevent subsequent file choosers from appearing.
The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `FileChooser` class.
## Example
```ts
const [fileChooser] = await Promise.all([
page.waitForFileChooser(),
page.click('#upload-file-button'), // some button that triggers file selection
]);
await fileChooser.accept(['/tmp/myfile.pdf']);
```
## Methods
| Method | Modifiers | Description |
| ----------------------------------------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| [accept(paths)](./puppeteer.filechooser.accept.md) | | Accept the file chooser request with the given file paths. |
| [cancel()](./puppeteer.filechooser.cancel.md) | | Closes the file chooser without selecting any files. |
| [isMultiple()](./puppeteer.filechooser.ismultiple.md) | | Whether file chooser allow for [multiple](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#attr-multiple) file selection. |

View File

@ -1,48 +0,0 @@
---
sidebar_label: Frame.$$eval
---
# Frame.$$eval() method
Runs the given function on an array of elements matching the given selector in the frame.
If the given function returns a promise, then this method will wait till the promise resolves.
#### Signature:
```typescript
class Frame {
$$eval<
Selector extends string,
Params extends unknown[],
Func extends EvaluateFuncWith<
Array<NodeFor<Selector>>,
Params
> = EvaluateFuncWith<Array<NodeFor<Selector>>, Params>,
>(
selector: Selector,
pageFunction: string | Func,
...args: Params
): Promise<Awaited<ReturnType<Func>>>;
}
```
## Parameters
| Parameter | Type | Description |
| ------------ | -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| selector | Selector | The selector to query for. |
| pageFunction | string \| Func | The function to be evaluated in the frame'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>. |
**Returns:**
Promise&lt;Awaited&lt;ReturnType&lt;Func&gt;&gt;&gt;
A promise to the result of the function.
## Example
```ts
const divsCounts = await frame.$$eval('div', divs => divs.length);
```

View File

@ -1,48 +0,0 @@
---
sidebar_label: Frame.$eval
---
# Frame.$eval() method
Runs the given function on the first element matching the given selector in the frame.
If the given function returns a promise, then this method will wait till the promise resolves.
#### Signature:
```typescript
class Frame {
$eval<
Selector extends string,
Params extends unknown[],
Func extends EvaluateFuncWith<NodeFor<Selector>, Params> = EvaluateFuncWith<
NodeFor<Selector>,
Params
>,
>(
selector: Selector,
pageFunction: string | Func,
...args: Params
): Promise<Awaited<ReturnType<Func>>>;
}
```
## Parameters
| Parameter | Type | Description |
| ------------ | -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| selector | Selector | The selector to query for. |
| pageFunction | string \| Func | The function to be evaluated in the frame's context. The first element matching the selector will be passed to the function as its first argument. |
| args | Params | Additional arguments to pass to <code>pageFunction</code>. |
**Returns:**
Promise&lt;Awaited&lt;ReturnType&lt;Func&gt;&gt;&gt;
A promise to the result of the function.
## Example
```ts
const searchValue = await frame.$eval('#search', el => el.value);
```

View File

@ -1,105 +0,0 @@
---
sidebar_label: Frame
---
# Frame class
Represents a DOM frame.
To understand frames, you can think of frames as `<iframe>` elements. Just like iframes, frames can be nested, and when JavaScript is executed in a frame, the JavaScript does not effect frames inside the ambient frame the JavaScript executes in.
#### Signature:
```typescript
export declare abstract class Frame extends EventEmitter<FrameEvents>
```
**Extends:** [EventEmitter](./puppeteer.eventemitter.md)&lt;[FrameEvents](./puppeteer.frameevents.md)&gt;
## Remarks
Frame lifecycles are controlled by three events that are all dispatched on the parent [page](./puppeteer.frame.page.md):
- [PageEvent.FrameAttached](./puppeteer.pageevent.md) - [PageEvent.FrameNavigated](./puppeteer.pageevent.md) - [PageEvent.FrameDetached](./puppeteer.pageevent.md)
The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `Frame` class.
## Example 1
At any point in time, [pages](./puppeteer.page.md) expose their current frame tree via the [Page.mainFrame()](./puppeteer.page.mainframe.md) and [Frame.childFrames()](./puppeteer.frame.childframes.md) methods.
## Example 2
An example of dumping frame tree:
```ts
import puppeteer from 'puppeteer';
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto('https://www.google.com/chrome/browser/canary.html');
dumpFrameTree(page.mainFrame(), '');
await browser.close();
function dumpFrameTree(frame, indent) {
console.log(indent + frame.url());
for (const child of frame.childFrames()) {
dumpFrameTree(child, indent + ' ');
}
}
})();
```
## Example 3
An example of getting text from an iframe element:
```ts
const frame = page.frames().find(frame => frame.name() === 'myframe');
const text = await frame.$eval('.selector', element => element.textContent);
console.log(text);
```
## Properties
| Property | Modifiers | Type | Description |
| -------- | --------------------- | ------- | ----------- |
| detached | <code>readonly</code> | boolean | |
## Methods
| Method | Modifiers | Description |
| ------------------------------------------------------------------------------------ | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [$(selector)](./puppeteer.frame._.md) | | Queries the frame for an element matching the given selector. |
| [$$(selector)](./puppeteer.frame.__.md) | | Queries the frame for all elements matching the given selector. |
| [$$eval(selector, pageFunction, args)](./puppeteer.frame.__eval.md) | | <p>Runs the given function on an array of elements matching the given selector in the frame.</p><p>If the given function returns a promise, then this method will wait till the promise resolves.</p> |
| [$eval(selector, pageFunction, args)](./puppeteer.frame._eval.md) | | <p>Runs the given function on the first element matching the given selector in the frame.</p><p>If the given function returns a promise, then this method will wait till the promise resolves.</p> |
| [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>HTMLStyleElement</code> into the frame with the desired URL |
| [addStyleTag(options)](./puppeteer.frame.addstyletag_1.md) | | Adds a <code>HTMLLinkElement</code> into the frame with the desired URL |
| [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) | | 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 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>. |
| [frameElement()](./puppeteer.frame.frameelement.md) | | |
| [goto(url, options)](./puppeteer.frame.goto.md) | | Navigates the frame to the given <code>url</code>. |
| [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) | | 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>. |
| [locator(selector)](./puppeteer.frame.locator.md) | | Creates a locator for the provided selector. See [Locator](./puppeteer.locator.md) for details and supported actions. |
| [locator(func)](./puppeteer.frame.locator_1.md) | | Creates a locator for the provided function. See [Locator](./puppeteer.locator.md) for details and supported actions. |
| [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) | | 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) | | The frame's URL. |
| [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> |
| [waitForSelector(selector, options)](./puppeteer.frame.waitforselector.md) | | <p>Waits for an element matching the given selector to appear in the frame.</p><p>This method works across navigations.</p> |

View File

@ -1,39 +0,0 @@
---
sidebar_label: Frame.select
---
# Frame.select() method
Selects a set of value on the first `<select>` element that matches the `selector`.
#### Signature:
```typescript
class Frame {
select(selector: string, ...values: string[]): Promise<string[]>;
}
```
## Parameters
| Parameter | Type | Description |
| --------- | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| selector | string | The selector to query for. |
| values | string\[\] | The array of values to select. If the <code>&lt;select&gt;</code> has the <code>multiple</code> attribute, all values are considered, otherwise only the first one is taken into account. |
**Returns:**
Promise&lt;string\[\]&gt;
the list of values that were successfully selected.
## Exceptions
Throws if there's no `<select>` matching `selector`.
## Example
```ts
frame.select('select#colors', 'blue'); // single selection
frame.select('select#colors', 'red', 'green', 'blue'); // multiple selections
```

View File

@ -1,26 +0,0 @@
---
sidebar_label: Frame.setContent
---
# Frame.setContent() method
Set the content of the frame.
#### Signature:
```typescript
class Frame {
abstract setContent(html: string, options?: WaitForOptions): Promise<void>;
}
```
## Parameters
| Parameter | Type | Description |
| --------- | ----------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| html | string | HTML markup to assign to the page. |
| options | [WaitForOptions](./puppeteer.waitforoptions.md) | _(Optional)_ Options to configure how long before timing out and at what point to consider the content setting successful. |
**Returns:**
Promise&lt;void&gt;

View File

@ -1,42 +0,0 @@
---
sidebar_label: Frame.type
---
# Frame.type() method
Sends a `keydown`, `keypress`/`input`, and `keyup` event for each character in the text.
#### Signature:
```typescript
class Frame {
type(
selector: string,
text: string,
options?: Readonly<KeyboardTypeOptions>
): Promise<void>;
}
```
## Parameters
| Parameter | Type | Description |
| --------- | ------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| selector | string | the selector for the element to type into. If there are multiple the first will be used. |
| text | string | text to type into the element |
| options | Readonly&lt;[KeyboardTypeOptions](./puppeteer.keyboardtypeoptions.md)&gt; | _(Optional)_ takes one option, <code>delay</code>, which sets the time to wait between key presses in milliseconds. Defaults to <code>0</code>. |
**Returns:**
Promise&lt;void&gt;
## Remarks
To press a special key, like `Control` or `ArrowDown`, use [Keyboard.press()](./puppeteer.keyboard.press.md).
## Example
```ts
await frame.type('#mytextarea', 'Hello'); // Types instantly
await frame.type('#mytextarea', 'World', {delay: 100}); // Types slower, like a user
```

View File

@ -1,21 +0,0 @@
---
sidebar_label: FrameAddScriptTagOptions
---
# FrameAddScriptTagOptions interface
#### Signature:
```typescript
export interface FrameAddScriptTagOptions
```
## Properties
| Property | Modifiers | Type | Description | Default |
| -------- | --------------------- | ------ | ---------------------------------------------------------------------------------------------------- | ------- |
| content | <code>optional</code> | string | JavaScript to be injected into the frame. | |
| id | <code>optional</code> | string | Sets the <code>id</code> of the script. | |
| path | <code>optional</code> | string | Path to a JavaScript file to be injected into the frame. | |
| type | <code>optional</code> | string | Sets the <code>type</code> of the script. Use <code>module</code> in order to load an ES2015 module. | |
| url | <code>optional</code> | string | URL of the script to be added. | |

View File

@ -1,19 +0,0 @@
---
sidebar_label: FrameAddStyleTagOptions
---
# FrameAddStyleTagOptions interface
#### Signature:
```typescript
export interface FrameAddStyleTagOptions
```
## Properties
| Property | Modifiers | Type | Description | Default |
| -------- | --------------------- | ------ | ----------------------------------------------------- | ------- |
| content | <code>optional</code> | string | Raw CSS content to be injected into the frame. | |
| path | <code>optional</code> | string | The path to a CSS file to be injected into the frame. | |
| url | <code>optional</code> | string | the URL of the CSS file to be added. | |

View File

@ -1,19 +0,0 @@
---
sidebar_label: FrameWaitForFunctionOptions
---
# FrameWaitForFunctionOptions interface
#### Signature:
```typescript
export interface FrameWaitForFunctionOptions
```
## Properties
| Property | Modifiers | Type | Description | Default |
| -------- | --------------------- | ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
| polling | <code>optional</code> | 'raf' \| 'mutation' \| number | <p>An interval at which the <code>pageFunction</code> is executed, defaults to <code>raf</code>. If <code>polling</code> is a number, then it is treated as an interval in milliseconds at which the function would be executed. If <code>polling</code> is a string, then it can be one of the following values:</p><p>- <code>raf</code> - to constantly execute <code>pageFunction</code> in <code>requestAnimationFrame</code> callback. This is the tightest polling mode which is suitable to observe styling changes.</p><p>- <code>mutation</code> - to execute <code>pageFunction</code> on every DOM mutation.</p> | |
| signal | <code>optional</code> | AbortSignal | A signal object that allows you to cancel a waitForFunction call. | |
| timeout | <code>optional</code> | number | Maximum time to wait in milliseconds. Defaults to <code>30000</code> (30 seconds). Pass <code>0</code> to disable the timeout. Puppeteer's default timeout can be changed using [Page.setDefaultTimeout()](./puppeteer.page.setdefaulttimeout.md). | |

View File

@ -1,19 +0,0 @@
---
sidebar_label: GeolocationOptions
---
# GeolocationOptions interface
#### Signature:
```typescript
export interface GeolocationOptions
```
## Properties
| Property | Modifiers | Type | Description | Default |
| --------- | --------------------- | ------ | --------------------------------------------------------- | ------- |
| accuracy | <code>optional</code> | number | Optional non-negative accuracy value. | |
| latitude | | number | Longitude between <code>-180</code> and <code>180</code>. | |
| longitude | | number | Latitude between <code>-90</code> and <code>90</code>. | |

View File

@ -1,20 +0,0 @@
---
sidebar_label: GoToOptions
---
# GoToOptions interface
#### Signature:
```typescript
export interface GoToOptions extends WaitForOptions
```
**Extends:** [WaitForOptions](./puppeteer.waitforoptions.md)
## Properties
| Property | Modifiers | Type | Description | Default |
| -------------- | --------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
| referer | <code>optional</code> | string | If provided, it will take preference over the referer header value set by [page.setExtraHTTPHeaders()](./puppeteer.page.setextrahttpheaders.md). | |
| referrerPolicy | <code>optional</code> | string | If provided, it will take preference over the referer-policy header value set by [page.setExtraHTTPHeaders()](./puppeteer.page.setextrahttpheaders.md). | |

View File

@ -1,30 +0,0 @@
---
sidebar_label: HTTPRequest.abort
---
# HTTPRequest.abort() method
Aborts a request.
#### Signature:
```typescript
class HTTPRequest {
abstract abort(errorCode?: ErrorCode, priority?: number): Promise<void>;
}
```
## Parameters
| Parameter | Type | Description |
| --------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| errorCode | [ErrorCode](./puppeteer.errorcode.md) | _(Optional)_ optional error code to provide. |
| priority | number | _(Optional)_ If provided, intercept is resolved using cooperative handling rules. Otherwise, intercept is resolved immediately. |
**Returns:**
Promise&lt;void&gt;
## Remarks
To use this, request interception should be enabled with [Page.setRequestInterception()](./puppeteer.page.setrequestinterception.md). If it is not enabled, this method will throw an exception immediately.

View File

@ -1,67 +0,0 @@
---
sidebar_label: HTTPRequest
---
# HTTPRequest class
Represents an HTTP request sent by a page.
#### Signature:
```typescript
export declare abstract class HTTPRequest
```
## Remarks
Whenever the page sends a request, such as for a network resource, the following events are emitted by Puppeteer's `page`:
- `request`: emitted when the request is issued by the page. - `requestfinished` - emitted when the response body is downloaded and the request is complete.
If request fails at some point, then instead of `requestfinished` event the `requestfailed` event is emitted.
All of these events provide an instance of `HTTPRequest` representing the request that occurred:
```
page.on('request', request => ...)
```
NOTE: HTTP Error responses, such as 404 or 503, are still successful responses from HTTP standpoint, so request will complete with `requestfinished` event.
If request gets a 'redirect' response, the request is successfully finished with the `requestfinished` event, and a new request is issued to a redirected url.
The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `HTTPRequest` class.
## Properties
| Property | Modifiers | Type | Description |
| -------- | --------------------- | --------------------------------------- | ----------------------------------------------------------------- |
| client | <code>readonly</code> | [CDPSession](./puppeteer.cdpsession.md) | Warning! Using this client can break Puppeteer. Use with caution. |
## Methods
| 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. |
| [fetchPostData()](./puppeteer.httprequest.fetchpostdata.md) | | Fetches the POST data for the request from the browser. |
| [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. |
| [hasPostData()](./puppeteer.httprequest.haspostdata.md) | | True when the request has POST data. Note that [HTTPRequest.postData()](./puppeteer.httprequest.postdata.md) might still be undefined when this flag is true when the data is too long or not readily available in the decoded form. In that case, use [HTTPRequest.fetchPostData()](./puppeteer.httprequest.fetchpostdata.md). |
| [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

@ -1,37 +0,0 @@
---
sidebar_label: HTTPResponse
---
# HTTPResponse class
The HTTPResponse class represents responses which are received by the [Page](./puppeteer.page.md) class.
#### Signature:
```typescript
export declare abstract class HTTPResponse
```
## Remarks
The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `HTTPResponse` class.
## Methods
| 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

@ -1,22 +0,0 @@
---
sidebar_label: InterceptResolutionAction
---
# InterceptResolutionAction enum
#### Signature:
```typescript
export declare enum InterceptResolutionAction
```
## Enumeration Members
| Member | Value | Description |
| -------------- | ---------------------------------------- | ----------- |
| Abort | <code>&quot;abort&quot;</code> | |
| AlreadyHandled | <code>&quot;already-handled&quot;</code> | |
| Continue | <code>&quot;continue&quot;</code> | |
| Disabled | <code>&quot;disabled&quot;</code> | |
| None | <code>&quot;none&quot;</code> | |
| Respond | <code>&quot;respond&quot;</code> | |

View File

@ -1,18 +0,0 @@
---
sidebar_label: InterceptResolutionState
---
# InterceptResolutionState interface
#### Signature:
```typescript
export interface InterceptResolutionState
```
## Properties
| Property | Modifiers | Type | Description | Default |
| -------- | --------------------- | --------------------------------------------------------------------- | ----------- | ------- |
| action | | [InterceptResolutionAction](./puppeteer.interceptresolutionaction.md) | | |
| priority | <code>optional</code> | number | | |

View File

@ -1,24 +0,0 @@
---
sidebar_label: JSCoverage
---
# JSCoverage class
#### Signature:
```typescript
export declare class JSCoverage
```
## Constructors
| Constructor | Modifiers | Description |
| ---------------------------------------------------------------- | --------- | -------------------------------------------------------------- |
| [(constructor)(client)](./puppeteer.jscoverage._constructor_.md) | | Constructs a new instance of the <code>JSCoverage</code> class |
## Methods
| Method | Modifiers | Description |
| ------------------------------------------------- | --------- | ----------- |
| [start(options)](./puppeteer.jscoverage.start.md) | | |
| [stop()](./puppeteer.jscoverage.stop.md) | | |

View File

@ -1,28 +0,0 @@
---
sidebar_label: JSCoverage.start
---
# JSCoverage.start() method
#### Signature:
```typescript
class JSCoverage {
start(options?: {
resetOnNavigation?: boolean;
reportAnonymousScripts?: boolean;
includeRawScriptCoverage?: boolean;
useBlockCoverage?: boolean;
}): Promise<void>;
}
```
## Parameters
| Parameter | Type | Description |
| --------- | -------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
| options | &#123; resetOnNavigation?: boolean; reportAnonymousScripts?: boolean; includeRawScriptCoverage?: boolean; useBlockCoverage?: boolean; &#125; | _(Optional)_ |
**Returns:**
Promise&lt;void&gt;

View File

@ -1,21 +0,0 @@
---
sidebar_label: JSCoverageEntry
---
# JSCoverageEntry interface
The CoverageEntry class for JavaScript
#### Signature:
```typescript
export interface JSCoverageEntry extends CoverageEntry
```
**Extends:** [CoverageEntry](./puppeteer.coverageentry.md)
## Properties
| Property | Modifiers | Type | Description | Default |
| ----------------- | --------------------- | -------------------------------- | ----------------------------- | ------- |
| rawScriptCoverage | <code>optional</code> | Protocol.Profiler.ScriptCoverage | Raw V8 script coverage entry. | |

View File

@ -1,22 +0,0 @@
---
sidebar_label: JSCoverageOptions
---
# JSCoverageOptions interface
Set of configurable options for JS coverage.
#### Signature:
```typescript
export interface JSCoverageOptions
```
## Properties
| Property | Modifiers | Type | Description | Default |
| ------------------------ | --------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
| includeRawScriptCoverage | <code>optional</code> | boolean | Whether the result includes raw V8 script coverage entries. | |
| reportAnonymousScripts | <code>optional</code> | boolean | Whether anonymous scripts generated by the page should be reported. | |
| resetOnNavigation | <code>optional</code> | boolean | Whether to reset coverage on every navigation. | |
| useBlockCoverage | <code>optional</code> | boolean | Whether to collect coverage information at the block level. If true, coverage will be collected at the block level (this is the default). If false, coverage will be collected at the function level. | |

View File

@ -1,49 +0,0 @@
---
sidebar_label: JSHandle
---
# JSHandle class
Represents a reference to a JavaScript object. Instances can be created using [Page.evaluateHandle()](./puppeteer.page.evaluatehandle.md).
Handles prevent the referenced JavaScript object from being garbage-collected unless the handle is purposely [disposed](./puppeteer.jshandle.dispose.md). JSHandles are auto-disposed when their associated frame is navigated away or the parent context gets destroyed.
Handles can be used as arguments for any evaluation function such as [Page.$eval()](./puppeteer.page._eval.md), [Page.evaluate()](./puppeteer.page.evaluate.md), and [Page.evaluateHandle()](./puppeteer.page.evaluatehandle.md). They are resolved to their referenced object.
#### Signature:
```typescript
export declare abstract class JSHandle<T = unknown>
```
## Remarks
The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `JSHandle` class.
## Example
```ts
const windowHandle = await page.evaluateHandle(() => window);
```
## Properties
| Property | Modifiers | Type | Description |
| -------- | --------------------- | ------------- | -------------------------------------------------------------- |
| \_ | <code>optional</code> | T | Used for nominally typing [JSHandle](./puppeteer.jshandle.md). |
| move | | () =&gt; this | |
## Methods
| Method | Modifiers | Description |
| ---------------------------------------------------------------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [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. |
| [getProperties()](./puppeteer.jshandle.getproperties.md) | | Gets a map of handles representing the properties of the current handle. |
| [getProperty(propertyName)](./puppeteer.jshandle.getproperty.md) | | Fetches a single property from the referenced object. |
| [getProperty(propertyName)](./puppeteer.jshandle.getproperty_1.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

@ -1,37 +0,0 @@
---
sidebar_label: Keyboard.down
---
# Keyboard.down() method
Dispatches a `keydown` event.
#### Signature:
```typescript
class Keyboard {
abstract down(
key: KeyInput,
options?: Readonly<KeyDownOptions>
): Promise<void>;
}
```
## 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&lt;[KeyDownOptions](./puppeteer.keydownoptions.md)&gt; | _(Optional)_ An object of options. Accepts text which, if specified, generates an input event with this text. Accepts commands which, if specified, is the commands of keyboard shortcuts, see [Chromium Source Code](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/editing/commands/editor_command_names.h) for valid command names. |
**Returns:**
Promise&lt;void&gt;
## Remarks
If `key` is a single character and no modifier keys besides `Shift` are being held down, a `keypress`/`input` event will also generated. The `text` option can be specified to force an input event to be generated. If `key` is a modifier key, `Shift`, `Meta`, `Control`, or `Alt`, subsequent key presses will be sent with that modifier active. To release the modifier key, use [Keyboard.up()](./puppeteer.keyboard.up.md).
After the key is pressed once, subsequent calls to [Keyboard.down()](./puppeteer.keyboard.down.md) will have [repeat](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/repeat) set to true. To release the key, use [Keyboard.up()](./puppeteer.keyboard.up.md).
Modifier keys DO influence [Keyboard.down()](./puppeteer.keyboard.down.md). Holding down `Shift` will type the text in upper case.

View File

@ -1,35 +0,0 @@
---
sidebar_label: Keyboard.press
---
# Keyboard.press() method
Shortcut for [Keyboard.down()](./puppeteer.keyboard.down.md) and [Keyboard.up()](./puppeteer.keyboard.up.md).
#### Signature:
```typescript
class Keyboard {
abstract press(
key: KeyInput,
options?: Readonly<KeyPressOptions>
): Promise<void>;
}
```
## 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&lt;[KeyPressOptions](./puppeteer.keypressoptions.md)&gt; | _(Optional)_ An object of options. Accepts text which, if specified, generates an input event with this text. Accepts delay which, if specified, is the time to wait between <code>keydown</code> and <code>keyup</code> in milliseconds. Defaults to 0. Accepts commands which, if specified, is the commands of keyboard shortcuts, see [Chromium Source Code](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/editing/commands/editor_command_names.h) for valid command names. |
**Returns:**
Promise&lt;void&gt;
## Remarks
If `key` is a single character and no modifier keys besides `Shift` are being held down, a `keypress`/`input` event will also generated. The `text` option can be specified to force an input event to be generated.
Modifier keys DO effect [Keyboard.press()](./puppeteer.keyboard.press.md). Holding down `Shift` will type the text in upper case.

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