diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 46b8d23f7d9..e6f87049c05 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "15.5.0" + ".": "16.0.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index b2d1faef9b2..56f93132f22 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,26 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [16.0.0](https://github.com/puppeteer/puppeteer/compare/v15.5.0...v16.0.0) (2022-08-02) + + +### ⚠ BREAKING CHANGES + +* With Chromium, Puppeteer will now attach to page/iframe targets immediately to allow reliable configuration of targets. + +### Features + +* add Dockerfile ([#8315](https://github.com/puppeteer/puppeteer/issues/8315)) ([936ed86](https://github.com/puppeteer/puppeteer/commit/936ed8607ec0c3798d2b22b590d0be0ad361a888)) +* detect Firefox in connect() automatically ([#8718](https://github.com/puppeteer/puppeteer/issues/8718)) ([2abd772](https://github.com/puppeteer/puppeteer/commit/2abd772c9c3d2b86deb71541eaac41aceef94356)) +* use CDP's auto-attach mechanism ([#8520](https://github.com/puppeteer/puppeteer/issues/8520)) ([2cbfdeb](https://github.com/puppeteer/puppeteer/commit/2cbfdeb0ca388a45cedfae865266230e1291bd29)) + + +### Bug Fixes + +* address flakiness in frame handling ([#8688](https://github.com/puppeteer/puppeteer/issues/8688)) ([6f81b23](https://github.com/puppeteer/puppeteer/commit/6f81b23728a511f7b89eaa2b8f850b22d6c4ab24)) +* disable AcceptCHFrame ([#8706](https://github.com/puppeteer/puppeteer/issues/8706)) ([96d9608](https://github.com/puppeteer/puppeteer/commit/96d9608d1de17877414a649a0737661894dd96c8)), closes [#8479](https://github.com/puppeteer/puppeteer/issues/8479) +* use loaderId to reduce test flakiness ([#8717](https://github.com/puppeteer/puppeteer/issues/8717)) ([d2f6db2](https://github.com/puppeteer/puppeteer/commit/d2f6db20735342bb3f419e85adbd51ed10470044)) + ## [15.5.0](https://github.com/puppeteer/puppeteer/compare/v15.4.2...v15.5.0) (2022-07-21) diff --git a/package-lock.json b/package-lock.json index b02045cdbe7..ecd223e0eb1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "puppeteer", - "version": "15.5.0", + "version": "16.0.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "puppeteer", - "version": "15.5.0", + "version": "16.0.0", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { diff --git a/package.json b/package.json index 1de66903467..ae91d7ae583 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "puppeteer", - "version": "15.5.0", + "version": "16.0.0", "description": "A high-level API to control headless Chrome over the DevTools Protocol", "keywords": [ "puppeteer", diff --git a/src/generated/version.ts b/src/generated/version.ts index 36a17e56d38..49925b72cf9 100644 --- a/src/generated/version.ts +++ b/src/generated/version.ts @@ -1,4 +1,4 @@ /** * @internal */ -export const packageVersion = '15.5.0'; +export const packageVersion = '16.0.0'; diff --git a/website/versioned_docs/version-16.0.0/api/index.md b/website/versioned_docs/version-16.0.0/api/index.md new file mode 100644 index 00000000000..03f904ace7c --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/index.md @@ -0,0 +1,167 @@ +--- +sidebar_label: API +--- + +# API Reference + +## Classes + +| Class | Description | +| --------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [Accessibility](./puppeteer.accessibility.md) | The Accessibility class provides methods for inspecting Chromium's accessibility tree. The accessibility tree is used by assistive technology such as [screen readers](https://en.wikipedia.org/wiki/Screen_reader) or [switches](https://en.wikipedia.org/wiki/Switch_access). | +| [Browser](./puppeteer.browser.md) | A Browser is created when Puppeteer connects to a Chromium instance, either through [PuppeteerNode.launch()](./puppeteer.puppeteernode.launch.md) or [Puppeteer.connect()](./puppeteer.puppeteer.connect.md). | +| [BrowserContext](./puppeteer.browsercontext.md) | BrowserContexts provide a way to operate multiple independent browser sessions. When a browser is launched, it has a single BrowserContext used by default. The method [Browser.newPage](./puppeteer.browser.newpage.md) creates a page in the default browser context. | +| [BrowserFetcher](./puppeteer.browserfetcher.md) | BrowserFetcher can download and manage different versions of Chromium and Firefox. | +| [CDPSession](./puppeteer.cdpsession.md) | The CDPSession 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 gathers information about parts of JavaScript and CSS that were used by the page. | +| [CSSCoverage](./puppeteer.csscoverage.md) | | +| [CustomError](./puppeteer.customerror.md) | | +| [Dialog](./puppeteer.dialog.md) | Dialog instances are dispatched by the [Page](./puppeteer.page.md) via the dialog event. | +| [ElementHandle](./puppeteer.elementhandle.md) | ElementHandle represents an in-page DOM element. | +| [EventEmitter](./puppeteer.eventemitter.md) | The EventEmitter class that many Puppeteer classes extend. | +| [ExecutionContext](./puppeteer.executioncontext.md) |

This class represents a context for JavaScript execution. A \[Page\] might have many execution contexts: - each [frame](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe) has "default" execution context that is always created after frame is attached to DOM. This context is returned by the [Frame.executionContext()](./puppeteer.frame.executioncontext.md) method. - [Extension](https://developer.chrome.com/extensions)'s content scripts create additional execution contexts.

Besides pages, execution contexts can be found in [workers](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API).

| +| [FileChooser](./puppeteer.filechooser.md) | File choosers let you react to the page requesting for a file. | +| [Frame](./puppeteer.frame.md) | At every point of time, page exposes its current frame tree via the [page.mainFrame](./puppeteer.page.mainframe.md) and [frame.childFrames](./puppeteer.frame.childframes.md) methods. | +| [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) | Represents an in-page JavaScript object. JSHandles can be created with the [page.evaluateHandle](./puppeteer.page.evaluatehandle.md) method. | +| [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. | +| [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) |

Page provides methods to interact with a single tab or [extension background page](https://developer.chrome.com/extensions/background_pages) in Chromium.

:::note

One Browser instance might have multiple Page instances.

:::

| +| [ProtocolError](./puppeteer.protocolerror.md) | ProtocolError is emitted whenever there is an error from the protocol. | +| [Puppeteer](./puppeteer.puppeteer.md) |

The main Puppeteer class.

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 puppeteer. That class extends Puppeteer, so has all the methods documented below as well as all that are defined on [PuppeteerNode](./puppeteer.puppeteernode.md).

| +| [PuppeteerNode](./puppeteer.puppeteernode.md) |

Extends the main [Puppeteer](./puppeteer.puppeteer.md) class with Node specific behaviour for fetching and downloading browsers.

If you're using Puppeteer in a Node environment, this is the class you'll get when you run require('puppeteer') (or the equivalent ES import).

| +| [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) | | +| [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. | +| [WebWorker](./puppeteer.webworker.md) | The WebWorker class represents a [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API). | + +## Enumerations + +| Enumeration | Description | +| ------------------------------------------------------------------------- | --------------------------------------------------------------------- | +| [BrowserContextEmittedEvents](./puppeteer.browsercontextemittedevents.md) | | +| [BrowserEmittedEvents](./puppeteer.browseremittedevents.md) | All the events a [browser instance](./puppeteer.browser.md) may emit. | +| [InterceptResolutionAction](./puppeteer.interceptresolutionaction.md) | | +| [PageEmittedEvents](./puppeteer.pageemittedevents.md) | All the events that a page instance may emit. | + +## Functions + +| Function | Description | +| -------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| [clearCustomQueryHandlers()](./puppeteer.clearcustomqueryhandlers.md) | Clears all registered handlers. | +| [customQueryHandlerNames()](./puppeteer.customqueryhandlernames.md) | | +| [registerCustomQueryHandler(name, handler)](./puppeteer.registercustomqueryhandler.md) | Registers a [custom query handler](./puppeteer.customqueryhandler.md). | +| [unregisterCustomQueryHandler(name)](./puppeteer.unregistercustomqueryhandler.md) | | + +## Interfaces + +| Interface | Description | +| --------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [BoundingBox](./puppeteer.boundingbox.md) | | +| [BoxModel](./puppeteer.boxmodel.md) | | +| [BrowserConnectOptions](./puppeteer.browserconnectoptions.md) | Generic browser options that can be passed when launching any browser or when connecting to an existing browser instance. | +| [BrowserContextOptions](./puppeteer.browsercontextoptions.md) | BrowserContext options. | +| [BrowserFetcherOptions](./puppeteer.browserfetcheroptions.md) | | +| [BrowserFetcherRevisionInfo](./puppeteer.browserfetcherrevisioninfo.md) | | +| [BrowserLaunchArgumentOptions](./puppeteer.browserlaunchargumentoptions.md) | Launcher options that only apply to Chrome. | +| [CDPSessionOnMessageObject](./puppeteer.cdpsessiononmessageobject.md) | | +| [ClickOptions](./puppeteer.clickoptions.md) | | +| [CommonEventEmitter](./puppeteer.commoneventemitter.md) | | +| [ConnectionCallback](./puppeteer.connectioncallback.md) | | +| [ConnectionTransport](./puppeteer.connectiontransport.md) | | +| [ConnectOptions](./puppeteer.connectoptions.md) | | +| [ConsoleMessageLocation](./puppeteer.consolemessagelocation.md) | | +| [ContinueRequestOverrides](./puppeteer.continuerequestoverrides.md) | | +| [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) | Contains two functions queryOne and queryAll that can be [registered](./puppeteer.registercustomqueryhandler.md) as alternative querying strategies. The functions queryOne and queryAll are executed in the page context. queryOne should take an Element and a selector string as argument and return a single Element or null if no element is found. queryAll takes the same arguments but should instead return a NodeListOf<Element> or Array<Element> with all the elements that match the given query selector. | +| [Device](./puppeteer.device.md) | | +| [FrameAddScriptTagOptions](./puppeteer.frameaddscripttagoptions.md) | | +| [FrameAddStyleTagOptions](./puppeteer.frameaddstyletagoptions.md) | | +| [FrameWaitForFunctionOptions](./puppeteer.framewaitforfunctionoptions.md) | | +| [GeolocationOptions](./puppeteer.geolocationoptions.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. | +| [LaunchOptions](./puppeteer.launchoptions.md) | Generic launch options that can be passed when launching any browser. | +| [MediaFeature](./puppeteer.mediafeature.md) | | +| [Metrics](./puppeteer.metrics.md) | | +| [MouseOptions](./puppeteer.mouseoptions.md) | | +| [MouseWheelOptions](./puppeteer.mousewheeloptions.md) | | +| [NetworkConditions](./puppeteer.networkconditions.md) | | +| [Offset](./puppeteer.offset.md) | | +| [PageEventObject](./puppeteer.pageeventobject.md) |

Denotes the objects received by callback functions for page events.

See [PageEmittedEvents](./puppeteer.pageemittedevents.md) for more detail on the events and when they are emitted.

| +| [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) | | +| [PressOptions](./puppeteer.pressoptions.md) | | +| [ProductLauncher](./puppeteer.productlauncher.md) | Describes a launcher - a class that is able to create and launch a browser instance. | +| [PuppeteerErrors](./puppeteer.puppeteererrors.md) | | +| [PuppeteerLaunchOptions](./puppeteer.puppeteerlaunchoptions.md) | | +| [RemoteAddress](./puppeteer.remoteaddress.md) | | +| [ResponseForRequest](./puppeteer.responseforrequest.md) | Required response data to fulfill a request with. | +| [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) | Sets the viewport of the page. | +| [WaitForOptions](./puppeteer.waitforoptions.md) | | +| [WaitForSelectorOptions](./puppeteer.waitforselectoroptions.md) | | +| [WaitForTargetOptions](./puppeteer.waitfortargetoptions.md) | | +| [WaitTimeoutOptions](./puppeteer.waittimeoutoptions.md) | | + +## Variables + +| Variable | Description | +| --------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [connect](./puppeteer.connect.md) | | +| [createBrowserFetcher](./puppeteer.createbrowserfetcher.md) | | +| [DEFAULT_INTERCEPT_RESOLUTION_PRIORITY](./puppeteer.default_intercept_resolution_priority.md) | The default cooperative request interception resolution priority | +| [defaultArgs](./puppeteer.defaultargs.md) | | +| [devices](./puppeteer.devices.md) | A list of devices to be used with page.emulate(options). Actual list of devices can be found in [src/common/DeviceDescriptors.ts](https://github.com/puppeteer/puppeteer/blob/main/src/common/DeviceDescriptors.ts). | +| [errors](./puppeteer.errors.md) |

Puppeteer methods might throw errors if they are unable to fulfill a request. For example, page.waitForSelector(selector[, options]) might fail if the selector doesn't match any nodes during the given timeframe.

For certain types of errors Puppeteer uses specific error classes. These classes are available via puppeteer.errors.

| +| [EVALUATION_SCRIPT_URL](./puppeteer.evaluation_script_url.md) | | +| [executablePath](./puppeteer.executablepath.md) | | +| [launch](./puppeteer.launch.md) | | +| [networkConditions](./puppeteer.networkconditions.md) | A list of network conditions to be used with page.emulateNetworkConditions(networkConditions). Actual list of predefined conditions can be found in [src/common/NetworkConditions.ts](https://github.com/puppeteer/puppeteer/blob/main/src/common/NetworkConditions.ts). | + +## Type Aliases + +| Type Alias | Description | +| ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [ActionResult](./puppeteer.actionresult.md) | | +| [Awaitable](./puppeteer.awaitable.md) | | +| [ChromeReleaseChannel](./puppeteer.chromereleasechannel.md) | | +| [ConsoleMessageType](./puppeteer.consolemessagetype.md) | The supported types for console messages. | +| [DevicesMap](./puppeteer.devicesmap.md) | | +| [ErrorCode](./puppeteer.errorcode.md) | | +| [EvaluateFunc](./puppeteer.evaluatefunc.md) | | +| [EventType](./puppeteer.eventtype.md) | | +| [FlattenHandle](./puppeteer.flattenhandle.md) | | +| [HandleFor](./puppeteer.handlefor.md) | | +| [HandleOr](./puppeteer.handleor.md) | | +| [Handler](./puppeteer.handler.md) | | +| [InnerParams](./puppeteer.innerparams.md) | | +| [InterceptResolutionStrategy](./puppeteer.interceptresolutionstrategy.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) | +| [LowerCasePaperFormat](./puppeteer.lowercasepaperformat.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) | | +| [Platform](./puppeteer.platform.md) | Supported platforms. | +| [Product](./puppeteer.product.md) | Supported products. | +| [ProtocolLifeCycleEvent](./puppeteer.protocollifecycleevent.md) | | +| [PuppeteerLifeCycleEvent](./puppeteer.puppeteerlifecycleevent.md) | | +| [PuppeteerNodeLaunchOptions](./puppeteer.puppeteernodelaunchoptions.md) | Utility type exposed to enable users to define options that can be passed to puppeteer.launch without having to list the set of all types. | +| [ResourceType](./puppeteer.resourcetype.md) | Resource types for HTTPRequests as perceived by the rendering engine. | +| [TargetFilterCallback](./puppeteer.targetfiltercallback.md) | | diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.accessibility.md b/website/versioned_docs/version-16.0.0/api/puppeteer.accessibility.md new file mode 100644 index 00000000000..ae6178dc028 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.accessibility.md @@ -0,0 +1,29 @@ +--- +sidebar_label: Accessibility +--- + +# Accessibility class + +The Accessibility class provides methods for inspecting Chromium's accessibility tree. The accessibility tree is used by assistive technology such as [screen readers](https://en.wikipedia.org/wiki/Screen_reader) or [switches](https://en.wikipedia.org/wiki/Switch_access). + +**Signature:** + +```typescript +export declare class Accessibility +``` + +## Remarks + +Accessibility is a very platform-specific thing. On different platforms, there are different screen readers that might have wildly different output. + +Blink - Chrome's rendering engine - has a concept of "accessibility tree", which is then translated into different platform-specific APIs. Accessibility namespace gives users access to the Blink Accessibility Tree. + +Most of the accessibility tree gets filtered out when converting from Blink AX Tree to Platform-specific AX-Tree or by assistive technologies themselves. By default, Puppeteer tries to approximate this filtering, exposing only the "interesting" nodes of the tree. + +The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `Accessibility` class. + +## Methods + +| Method | Modifiers | Description | +| ---------------------------------------------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------- | +| [snapshot(options)](./puppeteer.accessibility.snapshot.md) | | Captures the current state of the accessibility tree. The returned object represents the root accessible node of the page. | diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.accessibility.snapshot.md b/website/versioned_docs/version-16.0.0/api/puppeteer.accessibility.snapshot.md new file mode 100644 index 00000000000..9b0a2057a78 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.accessibility.snapshot.md @@ -0,0 +1,59 @@ +--- +sidebar_label: Accessibility.snapshot +--- + +# Accessibility.snapshot() method + +Captures the current state of the accessibility tree. The returned object represents the root accessible node of the page. + +**Signature:** + +```typescript +class Accessibility { + snapshot(options?: SnapshotOptions): Promise; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ------------------------------------------------- | ----------------- | +| options | [SnapshotOptions](./puppeteer.snapshotoptions.md) | (Optional) | + +**Returns:** + +Promise<[SerializedAXNode](./puppeteer.serializedaxnode.md) \| null> + +An AXNode object representing the snapshot. + +## Remarks + +\*\*NOTE\*\* The Chromium accessibility tree contains nodes that go unused on most platforms and by most screen readers. Puppeteer will discard them as well for an easier to process tree, unless `interestingOnly` is set to `false`. + +## Example 1 + +An example of dumping the entire accessibility tree: + +```ts +const snapshot = await page.accessibility.snapshot(); +console.log(snapshot); +``` + +## Example 2 + +An example of logging the focused node's name: + +```ts +const snapshot = await page.accessibility.snapshot(); +const node = findFocusedNode(snapshot); +console.log(node && node.name); + +function findFocusedNode(node) { + if (node.focused) return node; + for (const child of node.children || []) { + const foundNode = findFocusedNode(child); + return foundNode; + } + return null; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.actionresult.md b/website/versioned_docs/version-16.0.0/api/puppeteer.actionresult.md new file mode 100644 index 00000000000..a5d3dd2c514 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.actionresult.md @@ -0,0 +1,11 @@ +--- +sidebar_label: ActionResult +--- + +# ActionResult type + +**Signature:** + +```typescript +export declare type ActionResult = 'continue' | 'abort' | 'respond'; +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.awaitable.md b/website/versioned_docs/version-16.0.0/api/puppeteer.awaitable.md new file mode 100644 index 00000000000..9f9e3222701 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.awaitable.md @@ -0,0 +1,11 @@ +--- +sidebar_label: Awaitable +--- + +# Awaitable type + +**Signature:** + +```typescript +export declare type Awaitable = T | PromiseLike; +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.boundingbox.height.md b/website/versioned_docs/version-16.0.0/api/puppeteer.boundingbox.height.md new file mode 100644 index 00000000000..50234295438 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.boundingbox.height.md @@ -0,0 +1,15 @@ +--- +sidebar_label: BoundingBox.height +--- + +# BoundingBox.height property + +the height of the element in pixels. + +**Signature:** + +```typescript +interface BoundingBox { + height: number; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.boundingbox.md b/website/versioned_docs/version-16.0.0/api/puppeteer.boundingbox.md new file mode 100644 index 00000000000..0912f5c97e7 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.boundingbox.md @@ -0,0 +1,20 @@ +--- +sidebar_label: BoundingBox +--- + +# BoundingBox interface + +**Signature:** + +```typescript +export interface BoundingBox extends Point +``` + +**Extends:** [Point](./puppeteer.point.md) + +## Properties + +| Property | Modifiers | Type | Description | +| ------------------------------------------- | --------- | ------ | ------------------------------------ | +| [height](./puppeteer.boundingbox.height.md) | | number | the height of the element in pixels. | +| [width](./puppeteer.boundingbox.width.md) | | number | the width of the element in pixels. | diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.boundingbox.width.md b/website/versioned_docs/version-16.0.0/api/puppeteer.boundingbox.width.md new file mode 100644 index 00000000000..61411f3c95e --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.boundingbox.width.md @@ -0,0 +1,15 @@ +--- +sidebar_label: BoundingBox.width +--- + +# BoundingBox.width property + +the width of the element in pixels. + +**Signature:** + +```typescript +interface BoundingBox { + width: number; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.boxmodel.border.md b/website/versioned_docs/version-16.0.0/api/puppeteer.boxmodel.border.md new file mode 100644 index 00000000000..91ba7342627 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.boxmodel.border.md @@ -0,0 +1,13 @@ +--- +sidebar_label: BoxModel.border +--- + +# BoxModel.border property + +**Signature:** + +```typescript +interface BoxModel { + border: Point[]; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.boxmodel.content.md b/website/versioned_docs/version-16.0.0/api/puppeteer.boxmodel.content.md new file mode 100644 index 00000000000..b7234210166 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.boxmodel.content.md @@ -0,0 +1,13 @@ +--- +sidebar_label: BoxModel.content +--- + +# BoxModel.content property + +**Signature:** + +```typescript +interface BoxModel { + content: Point[]; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.boxmodel.height.md b/website/versioned_docs/version-16.0.0/api/puppeteer.boxmodel.height.md new file mode 100644 index 00000000000..8f957033d3b --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.boxmodel.height.md @@ -0,0 +1,13 @@ +--- +sidebar_label: BoxModel.height +--- + +# BoxModel.height property + +**Signature:** + +```typescript +interface BoxModel { + height: number; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.boxmodel.margin.md b/website/versioned_docs/version-16.0.0/api/puppeteer.boxmodel.margin.md new file mode 100644 index 00000000000..59d3ef93916 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.boxmodel.margin.md @@ -0,0 +1,13 @@ +--- +sidebar_label: BoxModel.margin +--- + +# BoxModel.margin property + +**Signature:** + +```typescript +interface BoxModel { + margin: Point[]; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.boxmodel.md b/website/versioned_docs/version-16.0.0/api/puppeteer.boxmodel.md new file mode 100644 index 00000000000..00c083c4fe3 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.boxmodel.md @@ -0,0 +1,22 @@ +--- +sidebar_label: BoxModel +--- + +# BoxModel interface + +**Signature:** + +```typescript +export interface BoxModel +``` + +## Properties + +| Property | Modifiers | Type | Description | +| ------------------------------------------ | --------- | --------------------------------- | ----------- | +| [border](./puppeteer.boxmodel.border.md) | | [Point](./puppeteer.point.md)\[\] | | +| [content](./puppeteer.boxmodel.content.md) | | [Point](./puppeteer.point.md)\[\] | | +| [height](./puppeteer.boxmodel.height.md) | | number | | +| [margin](./puppeteer.boxmodel.margin.md) | | [Point](./puppeteer.point.md)\[\] | | +| [padding](./puppeteer.boxmodel.padding.md) | | [Point](./puppeteer.point.md)\[\] | | +| [width](./puppeteer.boxmodel.width.md) | | number | | diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.boxmodel.padding.md b/website/versioned_docs/version-16.0.0/api/puppeteer.boxmodel.padding.md new file mode 100644 index 00000000000..d0c8c4d4fea --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.boxmodel.padding.md @@ -0,0 +1,13 @@ +--- +sidebar_label: BoxModel.padding +--- + +# BoxModel.padding property + +**Signature:** + +```typescript +interface BoxModel { + padding: Point[]; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.boxmodel.width.md b/website/versioned_docs/version-16.0.0/api/puppeteer.boxmodel.width.md new file mode 100644 index 00000000000..518c9fd146d --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.boxmodel.width.md @@ -0,0 +1,13 @@ +--- +sidebar_label: BoxModel.width +--- + +# BoxModel.width property + +**Signature:** + +```typescript +interface BoxModel { + width: number; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browser.browsercontexts.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browser.browsercontexts.md new file mode 100644 index 00000000000..65b916c99ac --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browser.browsercontexts.md @@ -0,0 +1,19 @@ +--- +sidebar_label: Browser.browserContexts +--- + +# Browser.browserContexts() method + +Returns an array of all open browser contexts. In a newly created browser, this will return a single instance of [BrowserContext](./puppeteer.browsercontext.md). + +**Signature:** + +```typescript +class Browser { + browserContexts(): BrowserContext[]; +} +``` + +**Returns:** + +[BrowserContext](./puppeteer.browsercontext.md)\[\] diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browser.close.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browser.close.md new file mode 100644 index 00000000000..239a6bced11 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browser.close.md @@ -0,0 +1,19 @@ +--- +sidebar_label: Browser.close +--- + +# Browser.close() method + +Closes Chromium and all of its pages (if any were opened). The [Browser](./puppeteer.browser.md) object itself is considered to be disposed and cannot be used anymore. + +**Signature:** + +```typescript +class Browser { + close(): Promise; +} +``` + +**Returns:** + +Promise<void> diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browser.createincognitobrowsercontext.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browser.createincognitobrowsercontext.md new file mode 100644 index 00000000000..45c0ada29f5 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browser.createincognitobrowsercontext.md @@ -0,0 +1,41 @@ +--- +sidebar_label: Browser.createIncognitoBrowserContext +--- + +# Browser.createIncognitoBrowserContext() method + +Creates a new incognito browser context. This won't share cookies/cache with other browser contexts. + +**Signature:** + +```typescript +class Browser { + createIncognitoBrowserContext( + options?: BrowserContextOptions + ): Promise; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ------------------------------------------------------------- | ----------------- | +| options | [BrowserContextOptions](./puppeteer.browsercontextoptions.md) | (Optional) | + +**Returns:** + +Promise<[BrowserContext](./puppeteer.browsercontext.md)> + +## Example + +```ts +(async () => { + const browser = await puppeteer.launch(); + // Create a new incognito browser context. + const context = await browser.createIncognitoBrowserContext(); + // Create a new page in a pristine context. + const page = await context.newPage(); + // Do stuff + await page.goto('https://example.com'); +})(); +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browser.defaultbrowsercontext.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browser.defaultbrowsercontext.md new file mode 100644 index 00000000000..2b18461fc3d --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browser.defaultbrowsercontext.md @@ -0,0 +1,19 @@ +--- +sidebar_label: Browser.defaultBrowserContext +--- + +# Browser.defaultBrowserContext() method + +Returns the default browser context. The default browser context cannot be closed. + +**Signature:** + +```typescript +class Browser { + defaultBrowserContext(): BrowserContext; +} +``` + +**Returns:** + +[BrowserContext](./puppeteer.browsercontext.md) diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browser.disconnect.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browser.disconnect.md new file mode 100644 index 00000000000..7ee1ae568f2 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browser.disconnect.md @@ -0,0 +1,19 @@ +--- +sidebar_label: Browser.disconnect +--- + +# Browser.disconnect() method + +Disconnects Puppeteer from the browser, but leaves the Chromium process running. After calling `disconnect`, the [Browser](./puppeteer.browser.md) object is considered disposed and cannot be used anymore. + +**Signature:** + +```typescript +class Browser { + disconnect(): void; +} +``` + +**Returns:** + +void diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browser.isconnected.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browser.isconnected.md new file mode 100644 index 00000000000..cbcdee36019 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browser.isconnected.md @@ -0,0 +1,19 @@ +--- +sidebar_label: Browser.isConnected +--- + +# Browser.isConnected() method + +Indicates that the browser is connected. + +**Signature:** + +```typescript +class Browser { + isConnected(): boolean; +} +``` + +**Returns:** + +boolean diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browser.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browser.md new file mode 100644 index 00000000000..f56e6bc11d5 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browser.md @@ -0,0 +1,77 @@ +--- +sidebar_label: Browser +--- + +# Browser class + +A Browser is created when Puppeteer connects to a Chromium instance, either through [PuppeteerNode.launch()](./puppeteer.puppeteernode.launch.md) or [Puppeteer.connect()](./puppeteer.puppeteer.connect.md). + +**Signature:** + +```typescript +export declare class Browser extends EventEmitter +``` + +**Extends:** [EventEmitter](./puppeteer.eventemitter.md) + +## Remarks + +The Browser class extends from Puppeteer's [EventEmitter](./puppeteer.eventemitter.md) class and will emit various events which are documented in the [BrowserEmittedEvents](./puppeteer.browseremittedevents.md) enum. + +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 + +An example of using a [Browser](./puppeteer.browser.md) to create a [Page](./puppeteer.page.md): + +```ts +const puppeteer = require('puppeteer'); + +(async () => { + const browser = await puppeteer.launch(); + const page = await browser.newPage(); + await page.goto('https://example.com'); + await browser.close(); +})(); +``` + +## Example 2 + +An example of disconnecting from and reconnecting to a [Browser](./puppeteer.browser.md): + +```ts +const puppeteer = require('puppeteer'); + +(async () => { + const browser = await puppeteer.launch(); + // Store the endpoint to be able to reconnect to Chromium + const browserWSEndpoint = browser.wsEndpoint(); + // Disconnect puppeteer from Chromium + browser.disconnect(); + + // Use the endpoint to reestablish a connection + const browser2 = await puppeteer.connect({browserWSEndpoint}); + // Close Chromium + await browser2.close(); +})(); +``` + +## Methods + +| Method | Modifiers | Description | +| ---------------------------------------------------------------------------------------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [browserContexts()](./puppeteer.browser.browsercontexts.md) | | Returns an array of all open browser contexts. In a newly created browser, this will return a single instance of [BrowserContext](./puppeteer.browsercontext.md). | +| [close()](./puppeteer.browser.close.md) | | Closes Chromium and all of its pages (if any were opened). The [Browser](./puppeteer.browser.md) object itself is considered to be disposed and cannot be used anymore. | +| [createIncognitoBrowserContext(options)](./puppeteer.browser.createincognitobrowsercontext.md) | | Creates a new incognito browser context. This won't share cookies/cache with other browser contexts. | +| [defaultBrowserContext()](./puppeteer.browser.defaultbrowsercontext.md) | | Returns the default browser context. The default browser context cannot be closed. | +| [disconnect()](./puppeteer.browser.disconnect.md) | | Disconnects Puppeteer from the browser, but leaves the Chromium process running. After calling disconnect, the [Browser](./puppeteer.browser.md) object is considered disposed and cannot be used anymore. | +| [isConnected()](./puppeteer.browser.isconnected.md) | | Indicates that the browser is connected. | +| [newPage()](./puppeteer.browser.newpage.md) | | Promise which resolves to a new [Page](./puppeteer.page.md) object. The Page is created in a default browser context. | +| [pages()](./puppeteer.browser.pages.md) | | An array of all open pages inside the Browser. | +| [process()](./puppeteer.browser.process.md) | | The spawned browser process. Returns null if the browser instance was created with [Puppeteer.connect()](./puppeteer.puppeteer.connect.md). | +| [target()](./puppeteer.browser.target.md) | | The target associated with the browser. | +| [targets()](./puppeteer.browser.targets.md) | | All active targets inside the Browser. In case of multiple browser contexts, returns an array with all the targets in all browser contexts. | +| [userAgent()](./puppeteer.browser.useragent.md) | | The browser's original user agent. Pages can override the browser user agent with [Page.setUserAgent()](./puppeteer.page.setuseragent.md). | +| [version()](./puppeteer.browser.version.md) | | A string representing the browser name and version. | +| [waitForTarget(predicate, options)](./puppeteer.browser.waitfortarget.md) | | Searches for a target in all browser contexts. | +| [wsEndpoint()](./puppeteer.browser.wsendpoint.md) | | The browser websocket endpoint which can be used as an argument to [Puppeteer.connect()](./puppeteer.puppeteer.connect.md). | diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browser.newpage.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browser.newpage.md new file mode 100644 index 00000000000..37841600a43 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browser.newpage.md @@ -0,0 +1,19 @@ +--- +sidebar_label: Browser.newPage +--- + +# Browser.newPage() method + +Promise which resolves to a new [Page](./puppeteer.page.md) object. The Page is created in a default browser context. + +**Signature:** + +```typescript +class Browser { + newPage(): Promise; +} +``` + +**Returns:** + +Promise<[Page](./puppeteer.page.md)> diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browser.pages.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browser.pages.md new file mode 100644 index 00000000000..e6c531963ec --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browser.pages.md @@ -0,0 +1,23 @@ +--- +sidebar_label: Browser.pages +--- + +# Browser.pages() method + +An array of all open pages inside the Browser. + +**Signature:** + +```typescript +class Browser { + pages(): Promise; +} +``` + +**Returns:** + +Promise<[Page](./puppeteer.page.md)\[\]> + +## Remarks + +In case of multiple browser contexts, returns an array with all the pages in all browser contexts. Non-visible pages, such as `"background_page"`, will not be listed here. You can find them using [Target.page()](./puppeteer.target.page.md). diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browser.process.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browser.process.md new file mode 100644 index 00000000000..3bd33c69551 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browser.process.md @@ -0,0 +1,19 @@ +--- +sidebar_label: Browser.process +--- + +# Browser.process() method + +The spawned browser process. Returns `null` if the browser instance was created with [Puppeteer.connect()](./puppeteer.puppeteer.connect.md). + +**Signature:** + +```typescript +class Browser { + process(): ChildProcess | null; +} +``` + +**Returns:** + +ChildProcess \| null diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browser.target.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browser.target.md new file mode 100644 index 00000000000..b4f9477bb8b --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browser.target.md @@ -0,0 +1,19 @@ +--- +sidebar_label: Browser.target +--- + +# Browser.target() method + +The target associated with the browser. + +**Signature:** + +```typescript +class Browser { + target(): Target; +} +``` + +**Returns:** + +[Target](./puppeteer.target.md) diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browser.targets.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browser.targets.md new file mode 100644 index 00000000000..522860268b3 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browser.targets.md @@ -0,0 +1,19 @@ +--- +sidebar_label: Browser.targets +--- + +# Browser.targets() method + +All active targets inside the Browser. In case of multiple browser contexts, returns an array with all the targets in all browser contexts. + +**Signature:** + +```typescript +class Browser { + targets(): Target[]; +} +``` + +**Returns:** + +[Target](./puppeteer.target.md)\[\] diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browser.useragent.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browser.useragent.md new file mode 100644 index 00000000000..1497cf4849b --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browser.useragent.md @@ -0,0 +1,19 @@ +--- +sidebar_label: Browser.userAgent +--- + +# Browser.userAgent() method + +The browser's original user agent. Pages can override the browser user agent with [Page.setUserAgent()](./puppeteer.page.setuseragent.md). + +**Signature:** + +```typescript +class Browser { + userAgent(): Promise; +} +``` + +**Returns:** + +Promise<string> diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browser.version.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browser.version.md new file mode 100644 index 00000000000..dbd489c68dd --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browser.version.md @@ -0,0 +1,25 @@ +--- +sidebar_label: Browser.version +--- + +# Browser.version() method + +A string representing the browser name and version. + +**Signature:** + +```typescript +class Browser { + version(): Promise; +} +``` + +**Returns:** + +Promise<string> + +## Remarks + +For headless Chromium, this is similar to `HeadlessChrome/61.0.3153.0`. For non-headless, this is similar to `Chrome/61.0.3153.0`. + +The format of browser.version() might change with future releases of Chromium. diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browser.waitfortarget.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browser.waitfortarget.md new file mode 100644 index 00000000000..c8708d16560 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browser.waitfortarget.md @@ -0,0 +1,42 @@ +--- +sidebar_label: Browser.waitForTarget +--- + +# Browser.waitForTarget() method + +Searches for a target in all browser contexts. + +**Signature:** + +```typescript +class Browser { + waitForTarget( + predicate: (x: Target) => boolean | Promise, + options?: WaitForTargetOptions + ): Promise; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ---------------------------------------------------------------------------- | -------------------------------------- | +| predicate | (x: [Target](./puppeteer.target.md)) => boolean \| Promise<boolean> | A function to be run for every target. | +| options | [WaitForTargetOptions](./puppeteer.waitfortargetoptions.md) | (Optional) | + +**Returns:** + +Promise<[Target](./puppeteer.target.md)> + +The first target found that matches the `predicate` function. + +## Example + +An example of finding a target for a page opened via `window.open`: + +```ts +await page.evaluate(() => window.open('https://www.example.com/')); +const newWindowTarget = await browser.waitForTarget( + target => target.url() === 'https://www.example.com/' +); +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browser.wsendpoint.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browser.wsendpoint.md new file mode 100644 index 00000000000..af522a6f014 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browser.wsendpoint.md @@ -0,0 +1,27 @@ +--- +sidebar_label: Browser.wsEndpoint +--- + +# Browser.wsEndpoint() method + +The browser websocket endpoint which can be used as an argument to [Puppeteer.connect()](./puppeteer.puppeteer.connect.md). + +**Signature:** + +```typescript +class Browser { + wsEndpoint(): string; +} +``` + +**Returns:** + +string + +The Browser websocket url. + +## Remarks + +The format is `ws://${host}:${port}/devtools/browser/`. + +You can find the `webSocketDebuggerUrl` from `http://${host}:${port}/json/version`. Learn more about the [devtools protocol](https://chromedevtools.github.io/devtools-protocol) and the [browser endpoint](https://chromedevtools.github.io/devtools-protocol/#how-do-i-access-the-browser-target). diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browserconnectoptions.defaultviewport.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browserconnectoptions.defaultviewport.md new file mode 100644 index 00000000000..c3ead5be18d --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browserconnectoptions.defaultviewport.md @@ -0,0 +1,15 @@ +--- +sidebar_label: BrowserConnectOptions.defaultViewport +--- + +# BrowserConnectOptions.defaultViewport property + +Sets the viewport for each page. + +**Signature:** + +```typescript +interface BrowserConnectOptions { + defaultViewport?: Viewport | null; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browserconnectoptions.ignorehttpserrors.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browserconnectoptions.ignorehttpserrors.md new file mode 100644 index 00000000000..72534446440 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browserconnectoptions.ignorehttpserrors.md @@ -0,0 +1,15 @@ +--- +sidebar_label: BrowserConnectOptions.ignoreHTTPSErrors +--- + +# BrowserConnectOptions.ignoreHTTPSErrors property + +Whether to ignore HTTPS errors during navigation. + +**Signature:** + +```typescript +interface BrowserConnectOptions { + ignoreHTTPSErrors?: boolean; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browserconnectoptions.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browserconnectoptions.md new file mode 100644 index 00000000000..bfcacef59cf --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browserconnectoptions.md @@ -0,0 +1,22 @@ +--- +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 | +| ---------------------------------------------------------------------------- | --------- | ----------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | +| [defaultViewport?](./puppeteer.browserconnectoptions.defaultviewport.md) | | [Viewport](./puppeteer.viewport.md) \| null | (Optional) Sets the viewport for each page. | +| [ignoreHTTPSErrors?](./puppeteer.browserconnectoptions.ignorehttpserrors.md) | | boolean | (Optional) Whether to ignore HTTPS errors during navigation. | +| [slowMo?](./puppeteer.browserconnectoptions.slowmo.md) | | number | (Optional) Slows down Puppeteer operations by the specified amount of milliseconds to aid debugging. | +| [targetFilter?](./puppeteer.browserconnectoptions.targetfilter.md) | | [TargetFilterCallback](./puppeteer.targetfiltercallback.md) | (Optional) Callback to decide if Puppeteer should connect to a given target or not. | diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browserconnectoptions.slowmo.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browserconnectoptions.slowmo.md new file mode 100644 index 00000000000..b89d37a8244 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browserconnectoptions.slowmo.md @@ -0,0 +1,15 @@ +--- +sidebar_label: BrowserConnectOptions.slowMo +--- + +# BrowserConnectOptions.slowMo property + +Slows down Puppeteer operations by the specified amount of milliseconds to aid debugging. + +**Signature:** + +```typescript +interface BrowserConnectOptions { + slowMo?: number; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browserconnectoptions.targetfilter.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browserconnectoptions.targetfilter.md new file mode 100644 index 00000000000..b3b16e0b21d --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browserconnectoptions.targetfilter.md @@ -0,0 +1,15 @@ +--- +sidebar_label: BrowserConnectOptions.targetFilter +--- + +# BrowserConnectOptions.targetFilter property + +Callback to decide if Puppeteer should connect to a given target or not. + +**Signature:** + +```typescript +interface BrowserConnectOptions { + targetFilter?: TargetFilterCallback; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browsercontext.browser.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browsercontext.browser.md new file mode 100644 index 00000000000..1a33d29accf --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browsercontext.browser.md @@ -0,0 +1,19 @@ +--- +sidebar_label: BrowserContext.browser +--- + +# BrowserContext.browser() method + +The browser this browser context belongs to. + +**Signature:** + +```typescript +class BrowserContext { + browser(): Browser; +} +``` + +**Returns:** + +[Browser](./puppeteer.browser.md) diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browsercontext.clearpermissionoverrides.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browsercontext.clearpermissionoverrides.md new file mode 100644 index 00000000000..d1627f08010 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browsercontext.clearpermissionoverrides.md @@ -0,0 +1,28 @@ +--- +sidebar_label: BrowserContext.clearPermissionOverrides +--- + +# BrowserContext.clearPermissionOverrides() method + +Clears all permission overrides for the browser context. + +**Signature:** + +```typescript +class BrowserContext { + clearPermissionOverrides(): Promise; +} +``` + +**Returns:** + +Promise<void> + +## Example + +```ts +const context = browser.defaultBrowserContext(); +context.overridePermissions('https://example.com', ['clipboard-read']); +// do stuff .. +context.clearPermissionOverrides(); +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browsercontext.close.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browsercontext.close.md new file mode 100644 index 00000000000..f6fc7ec9f62 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browsercontext.close.md @@ -0,0 +1,23 @@ +--- +sidebar_label: BrowserContext.close +--- + +# BrowserContext.close() method + +Closes the browser context. All the targets that belong to the browser context will be closed. + +**Signature:** + +```typescript +class BrowserContext { + close(): Promise; +} +``` + +**Returns:** + +Promise<void> + +## Remarks + +Only incognito browser contexts can be closed. diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browsercontext.isincognito.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browsercontext.isincognito.md new file mode 100644 index 00000000000..259925f01a7 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browsercontext.isincognito.md @@ -0,0 +1,23 @@ +--- +sidebar_label: BrowserContext.isIncognito +--- + +# BrowserContext.isIncognito() method + +Returns whether BrowserContext is incognito. The default browser context is the only non-incognito browser context. + +**Signature:** + +```typescript +class BrowserContext { + isIncognito(): boolean; +} +``` + +**Returns:** + +boolean + +## Remarks + +The default browser context cannot be closed. diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browsercontext.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browsercontext.md new file mode 100644 index 00000000000..2374e40cdec --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browsercontext.md @@ -0,0 +1,52 @@ +--- +sidebar_label: BrowserContext +--- + +# BrowserContext class + +BrowserContexts provide a way to operate multiple independent browser sessions. When a browser is launched, it has a single BrowserContext used by default. The method [Browser.newPage](./puppeteer.browser.newpage.md) creates a page in the default browser context. + +**Signature:** + +```typescript +export declare class BrowserContext extends EventEmitter +``` + +**Extends:** [EventEmitter](./puppeteer.eventemitter.md) + +## Remarks + +The Browser class extends from Puppeteer's [EventEmitter](./puppeteer.eventemitter.md) class and will emit various events which are documented in the [BrowserContextEmittedEvents](./puppeteer.browsercontextemittedevents.md) enum. + +If a page opens another page, e.g. with a `window.open` call, the popup will belong to the parent page's browser context. + +Puppeteer allows creation of "incognito" browser contexts with [Browser.createIncognitoBrowserContext](./puppeteer.browser.createincognitobrowsercontext.md) method. "Incognito" browser contexts don't write any browsing data to disk. + +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 + +```ts +// Create a new incognito browser context +const context = await browser.createIncognitoBrowserContext(); +// 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(); +``` + +## Methods + +| Method | Modifiers | Description | +| --------------------------------------------------------------------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------- | +| [browser()](./puppeteer.browsercontext.browser.md) | | The browser this browser context belongs to. | +| [clearPermissionOverrides()](./puppeteer.browsercontext.clearpermissionoverrides.md) | | Clears all permission overrides for the browser context. | +| [close()](./puppeteer.browsercontext.close.md) | | Closes the browser context. All the targets that belong to the browser context will be closed. | +| [isIncognito()](./puppeteer.browsercontext.isincognito.md) | | Returns whether BrowserContext is incognito. The default browser context is the only non-incognito browser context. | +| [newPage()](./puppeteer.browsercontext.newpage.md) | | Creates a new page in the browser context. | +| [overridePermissions(origin, permissions)](./puppeteer.browsercontext.overridepermissions.md) | | | +| [pages()](./puppeteer.browsercontext.pages.md) | | An array of all pages inside the browser context. | +| [targets()](./puppeteer.browsercontext.targets.md) | | An array of all active targets inside the browser context. | +| [waitForTarget(predicate, options)](./puppeteer.browsercontext.waitfortarget.md) | | This searches for a target in this specific browser context. | diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browsercontext.newpage.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browsercontext.newpage.md new file mode 100644 index 00000000000..a32b8f3baa8 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browsercontext.newpage.md @@ -0,0 +1,19 @@ +--- +sidebar_label: BrowserContext.newPage +--- + +# BrowserContext.newPage() method + +Creates a new page in the browser context. + +**Signature:** + +```typescript +class BrowserContext { + newPage(): Promise; +} +``` + +**Returns:** + +Promise<[Page](./puppeteer.page.md)> diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browsercontext.overridepermissions.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browsercontext.overridepermissions.md new file mode 100644 index 00000000000..3baa631e83a --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browsercontext.overridepermissions.md @@ -0,0 +1,31 @@ +--- +sidebar_label: BrowserContext.overridePermissions +--- + +# BrowserContext.overridePermissions() method + +**Signature:** + +```typescript +class BrowserContext { + overridePermissions(origin: string, permissions: Permission[]): Promise; +} +``` + +## Parameters + +| Parameter | Type | Description | +| ----------- | ------------------------------------------- | -------------------------------------------------------------------------------------------------------- | +| origin | string | The origin to grant permissions to, e.g. "https://example.com". | +| permissions | [Permission](./puppeteer.permission.md)\[\] | An array of permissions to grant. All permissions that are not listed here will be automatically denied. | + +**Returns:** + +Promise<void> + +## Example + +```ts +const context = browser.defaultBrowserContext(); +await context.overridePermissions('https://html5demos.com', ['geolocation']); +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browsercontext.pages.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browsercontext.pages.md new file mode 100644 index 00000000000..02b0b3f530d --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browsercontext.pages.md @@ -0,0 +1,21 @@ +--- +sidebar_label: BrowserContext.pages +--- + +# BrowserContext.pages() method + +An array of all pages inside the browser context. + +**Signature:** + +```typescript +class BrowserContext { + pages(): Promise; +} +``` + +**Returns:** + +Promise<[Page](./puppeteer.page.md)\[\]> + +Promise which resolves to an array of all open pages. Non visible pages, such as `"background_page"`, will not be listed here. You can find them using [the target page](./puppeteer.target.page.md). diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browsercontext.targets.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browsercontext.targets.md new file mode 100644 index 00000000000..563b28b4415 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browsercontext.targets.md @@ -0,0 +1,19 @@ +--- +sidebar_label: BrowserContext.targets +--- + +# BrowserContext.targets() method + +An array of all active targets inside the browser context. + +**Signature:** + +```typescript +class BrowserContext { + targets(): Target[]; +} +``` + +**Returns:** + +[Target](./puppeteer.target.md)\[\] diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browsercontext.waitfortarget.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browsercontext.waitfortarget.md new file mode 100644 index 00000000000..0f07854c385 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browsercontext.waitfortarget.md @@ -0,0 +1,44 @@ +--- +sidebar_label: BrowserContext.waitForTarget +--- + +# BrowserContext.waitForTarget() method + +This searches for a target in this specific browser context. + +**Signature:** + +```typescript +class BrowserContext { + waitForTarget( + predicate: (x: Target) => boolean | Promise, + options?: { + timeout?: number; + } + ): Promise; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ---------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| predicate | (x: [Target](./puppeteer.target.md)) => boolean \| Promise<boolean> | A function to be run for every target | +| options | { timeout?: number; } | (Optional) An object of options. Accepts a timout, which is the maximum wait time in milliseconds. Pass 0 to disable the timeout. Defaults to 30 seconds. | + +**Returns:** + +Promise<[Target](./puppeteer.target.md)> + +Promise which resolves to the first target found that matches the `predicate` function. + +## Example + +An example of finding a target for a page opened via `window.open`: + +```ts +await page.evaluate(() => window.open('https://www.example.com/')); +const newWindowTarget = await browserContext.waitForTarget( + target => target.url() === 'https://www.example.com/' +); +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browsercontextemittedevents.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browsercontextemittedevents.md new file mode 100644 index 00000000000..045f69b8474 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browsercontextemittedevents.md @@ -0,0 +1,19 @@ +--- +sidebar_label: BrowserContextEmittedEvents +--- + +# BrowserContextEmittedEvents enum + +**Signature:** + +```typescript +export declare const enum BrowserContextEmittedEvents +``` + +## Enumeration Members + +| Member | Value | Description | +| --------------- | ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| TargetChanged | "targetchanged" | Emitted when the url of a target inside the browser context changes. Contains a [Target](./puppeteer.target.md) instance. | +| TargetCreated | "targetcreated" |

Emitted when a target is created within the browser context, for example when a new page is opened by [window.open](https://developer.mozilla.org/en-US/docs/Web/API/Window/open) or by [browserContext.newPage](./puppeteer.browsercontext.newpage.md)

Contains a [Target](./puppeteer.target.md) instance.

| +| TargetDestroyed | "targetdestroyed" | Emitted when a target is destroyed within the browser context, for example when a page is closed. Contains a [Target](./puppeteer.target.md) instance. | diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browsercontextoptions.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browsercontextoptions.md new file mode 100644 index 00000000000..0bf827371f5 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browsercontextoptions.md @@ -0,0 +1,20 @@ +--- +sidebar_label: BrowserContextOptions +--- + +# BrowserContextOptions interface + +BrowserContext options. + +**Signature:** + +```typescript +export interface BrowserContextOptions +``` + +## Properties + +| Property | Modifiers | Type | Description | +| ------------------------------------------------------------------------ | --------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | +| [proxyBypassList?](./puppeteer.browsercontextoptions.proxybypasslist.md) | | string\[\] | (Optional) Bypass the proxy for the given semi-colon-separated list of hosts. | +| [proxyServer?](./puppeteer.browsercontextoptions.proxyserver.md) | | string | (Optional) Proxy server with optional port to use for all requests. Username and password can be set in Page.authenticate. | diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browsercontextoptions.proxybypasslist.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browsercontextoptions.proxybypasslist.md new file mode 100644 index 00000000000..42f9d077e7f --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browsercontextoptions.proxybypasslist.md @@ -0,0 +1,15 @@ +--- +sidebar_label: BrowserContextOptions.proxyBypassList +--- + +# BrowserContextOptions.proxyBypassList property + +Bypass the proxy for the given semi-colon-separated list of hosts. + +**Signature:** + +```typescript +interface BrowserContextOptions { + proxyBypassList?: string[]; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browsercontextoptions.proxyserver.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browsercontextoptions.proxyserver.md new file mode 100644 index 00000000000..4ae31585a49 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browsercontextoptions.proxyserver.md @@ -0,0 +1,15 @@ +--- +sidebar_label: BrowserContextOptions.proxyServer +--- + +# BrowserContextOptions.proxyServer property + +Proxy server with optional port to use for all requests. Username and password can be set in `Page.authenticate`. + +**Signature:** + +```typescript +interface BrowserContextOptions { + proxyServer?: string; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browseremittedevents.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browseremittedevents.md new file mode 100644 index 00000000000..255ecc9967f --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browseremittedevents.md @@ -0,0 +1,22 @@ +--- +sidebar_label: BrowserEmittedEvents +--- + +# BrowserEmittedEvents enum + +All the events a [browser instance](./puppeteer.browser.md) may emit. + +**Signature:** + +```typescript +export declare const enum BrowserEmittedEvents +``` + +## Enumeration Members + +| Member | Value | Description | +| --------------- | ---------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Disconnected | "disconnected" |

Emitted when Puppeteer gets disconnected from the Chromium instance. This might happen because of one of the following:

- Chromium is closed or crashed

- The [browser.disconnect](./puppeteer.browser.disconnect.md) method was called.

| +| TargetChanged | "targetchanged" | Emitted when the url of a target changes. Contains a [Target](./puppeteer.target.md) instance. | +| TargetCreated | "targetcreated" |

Emitted when a target is created, for example when a new page is opened by [window.open](https://developer.mozilla.org/en-US/docs/Web/API/Window/open) or by [browser.newPage](./puppeteer.browser.newpage.md)

Contains a [Target](./puppeteer.target.md) instance.

| +| TargetDestroyed | "targetdestroyed" | Emitted when a target is destroyed, for example when a page is closed. Contains a [Target](./puppeteer.target.md) instance. | diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcher.candownload.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcher.candownload.md new file mode 100644 index 00000000000..172092d6629 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcher.candownload.md @@ -0,0 +1,31 @@ +--- +sidebar_label: BrowserFetcher.canDownload +--- + +# BrowserFetcher.canDownload() method + +Initiates a HEAD request to check if the revision is available. + +**Signature:** + +```typescript +class BrowserFetcher { + canDownload(revision: string): Promise; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ------ | --------------------------------------- | +| revision | string | The revision to check availability for. | + +**Returns:** + +Promise<boolean> + +A promise that resolves to `true` if the revision could be downloaded from the host. + +## Remarks + +This method is affected by the current `product`. diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcher.download.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcher.download.md new file mode 100644 index 00000000000..950f10f3ce1 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcher.download.md @@ -0,0 +1,35 @@ +--- +sidebar_label: BrowserFetcher.download +--- + +# BrowserFetcher.download() method + +Initiates a GET request to download the revision from the host. + +**Signature:** + +```typescript +class BrowserFetcher { + download( + revision: string, + progressCallback?: (x: number, y: number) => void + ): Promise; +} +``` + +## Parameters + +| Parameter | Type | Description | +| ---------------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| revision | string | The revision to download. | +| progressCallback | (x: number, y: number) => void | (Optional) A function that will be called with two arguments: How many bytes have been downloaded and the total number of bytes of the download. | + +**Returns:** + +Promise<[BrowserFetcherRevisionInfo](./puppeteer.browserfetcherrevisioninfo.md) \| undefined> + +A promise with revision information when the revision is downloaded and extracted. + +## Remarks + +This method is affected by the current `product`. diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcher.host.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcher.host.md new file mode 100644 index 00000000000..c866ea62abe --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcher.host.md @@ -0,0 +1,19 @@ +--- +sidebar_label: BrowserFetcher.host +--- + +# BrowserFetcher.host() method + +**Signature:** + +```typescript +class BrowserFetcher { + host(): string; +} +``` + +**Returns:** + +string + +The download host being used. diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcher.localrevisions.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcher.localrevisions.md new file mode 100644 index 00000000000..8f62f6bc15f --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcher.localrevisions.md @@ -0,0 +1,23 @@ +--- +sidebar_label: BrowserFetcher.localRevisions +--- + +# BrowserFetcher.localRevisions() method + +**Signature:** + +```typescript +class BrowserFetcher { + localRevisions(): Promise; +} +``` + +**Returns:** + +Promise<string\[\]> + +A promise with a list of all revision strings (for the current `product`) available locally on disk. + +## Remarks + +This method is affected by the current `product`. diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcher.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcher.md new file mode 100644 index 00000000000..5c9c876f731 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcher.md @@ -0,0 +1,46 @@ +--- +sidebar_label: BrowserFetcher +--- + +# BrowserFetcher class + +BrowserFetcher can download and manage different versions of Chromium and Firefox. + +**Signature:** + +```typescript +export declare class BrowserFetcher +``` + +## Remarks + +BrowserFetcher operates on revision strings that specify a precise version of Chromium, e.g. `"533271"`. Revision strings can be obtained from [omahaproxy.appspot.com](http://omahaproxy.appspot.com/). In the Firefox case, BrowserFetcher downloads Firefox Nightly and operates on version numbers such as `"75"`. + +The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `BrowserFetcher` class. + +## Example + +An example of using BrowserFetcher to download a specific version of Chromium and running Puppeteer against it: + +```ts +const browserFetcher = puppeteer.createBrowserFetcher(); +const revisionInfo = await browserFetcher.download('533271'); +const browser = await puppeteer.launch({ + executablePath: revisionInfo.executablePath, +}); +``` + +\*\*NOTE\*\* BrowserFetcher is not designed to work concurrently with other instances of BrowserFetcher that share the same downloads directory. + +## Methods + +| Method | Modifiers | Description | +| ------------------------------------------------------------------------------ | --------- | --------------------------------------------------------------- | +| [canDownload(revision)](./puppeteer.browserfetcher.candownload.md) | | Initiates a HEAD request to check if the revision is available. | +| [download(revision, progressCallback)](./puppeteer.browserfetcher.download.md) | | Initiates a GET request to download the revision from the host. | +| [host()](./puppeteer.browserfetcher.host.md) | | | +| [localRevisions()](./puppeteer.browserfetcher.localrevisions.md) | | | +| [platform()](./puppeteer.browserfetcher.platform.md) | | | +| [product()](./puppeteer.browserfetcher.product.md) | | | +| [remove(revision)](./puppeteer.browserfetcher.remove.md) | | | +| [revisionInfo(revision)](./puppeteer.browserfetcher.revisioninfo.md) | | | diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcher.platform.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcher.platform.md new file mode 100644 index 00000000000..f4db9721b73 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcher.platform.md @@ -0,0 +1,19 @@ +--- +sidebar_label: BrowserFetcher.platform +--- + +# BrowserFetcher.platform() method + +**Signature:** + +```typescript +class BrowserFetcher { + platform(): Platform; +} +``` + +**Returns:** + +[Platform](./puppeteer.platform.md) + +Returns the current `Platform`, which is one of `mac`, `linux`, `win32` or `win64`. diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcher.product.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcher.product.md new file mode 100644 index 00000000000..1219cd0e5b9 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcher.product.md @@ -0,0 +1,19 @@ +--- +sidebar_label: BrowserFetcher.product +--- + +# BrowserFetcher.product() method + +**Signature:** + +```typescript +class BrowserFetcher { + product(): Product; +} +``` + +**Returns:** + +[Product](./puppeteer.product.md) + +Returns the current `Product`, which is one of `chrome` or `firefox`. diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcher.remove.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcher.remove.md new file mode 100644 index 00000000000..6cb2b3bf3bd --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcher.remove.md @@ -0,0 +1,29 @@ +--- +sidebar_label: BrowserFetcher.remove +--- + +# BrowserFetcher.remove() method + +**Signature:** + +```typescript +class BrowserFetcher { + remove(revision: string): Promise; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ------ | ---------------------------------------------------------- | +| revision | string | A revision to remove for the current product. | + +**Returns:** + +Promise<void> + +A promise that resolves when the revision has been removes or throws if the revision has not been downloaded. + +## Remarks + +This method is affected by the current `product`. diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcher.revisioninfo.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcher.revisioninfo.md new file mode 100644 index 00000000000..ea18abd4a43 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcher.revisioninfo.md @@ -0,0 +1,25 @@ +--- +sidebar_label: BrowserFetcher.revisionInfo +--- + +# BrowserFetcher.revisionInfo() method + +**Signature:** + +```typescript +class BrowserFetcher { + revisionInfo(revision: string): BrowserFetcherRevisionInfo; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ------ | ----------------------------- | +| revision | string | The revision to get info for. | + +**Returns:** + +[BrowserFetcherRevisionInfo](./puppeteer.browserfetcherrevisioninfo.md) + +The revision info for the given revision. diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcheroptions.host.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcheroptions.host.md new file mode 100644 index 00000000000..7dd3a98136a --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcheroptions.host.md @@ -0,0 +1,13 @@ +--- +sidebar_label: BrowserFetcherOptions.host +--- + +# BrowserFetcherOptions.host property + +**Signature:** + +```typescript +interface BrowserFetcherOptions { + host?: string; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcheroptions.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcheroptions.md new file mode 100644 index 00000000000..af16c5710bb --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcheroptions.md @@ -0,0 +1,20 @@ +--- +sidebar_label: BrowserFetcherOptions +--- + +# BrowserFetcherOptions interface + +**Signature:** + +```typescript +export interface BrowserFetcherOptions +``` + +## Properties + +| Property | Modifiers | Type | Description | +| ---------------------------------------------------------- | --------- | ----------------------------------- | ----------------- | +| [host?](./puppeteer.browserfetcheroptions.host.md) | | string | (Optional) | +| [path?](./puppeteer.browserfetcheroptions.path.md) | | string | (Optional) | +| [platform?](./puppeteer.browserfetcheroptions.platform.md) | | [Platform](./puppeteer.platform.md) | (Optional) | +| [product?](./puppeteer.browserfetcheroptions.product.md) | | string | (Optional) | diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcheroptions.path.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcheroptions.path.md new file mode 100644 index 00000000000..5c44969eff6 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcheroptions.path.md @@ -0,0 +1,13 @@ +--- +sidebar_label: BrowserFetcherOptions.path +--- + +# BrowserFetcherOptions.path property + +**Signature:** + +```typescript +interface BrowserFetcherOptions { + path?: string; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcheroptions.platform.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcheroptions.platform.md new file mode 100644 index 00000000000..c2fc22a3ab6 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcheroptions.platform.md @@ -0,0 +1,13 @@ +--- +sidebar_label: BrowserFetcherOptions.platform +--- + +# BrowserFetcherOptions.platform property + +**Signature:** + +```typescript +interface BrowserFetcherOptions { + platform?: Platform; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcheroptions.product.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcheroptions.product.md new file mode 100644 index 00000000000..a009bae1195 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcheroptions.product.md @@ -0,0 +1,13 @@ +--- +sidebar_label: BrowserFetcherOptions.product +--- + +# BrowserFetcherOptions.product property + +**Signature:** + +```typescript +interface BrowserFetcherOptions { + product?: string; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcherrevisioninfo.executablepath.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcherrevisioninfo.executablepath.md new file mode 100644 index 00000000000..2dd3218e718 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcherrevisioninfo.executablepath.md @@ -0,0 +1,13 @@ +--- +sidebar_label: BrowserFetcherRevisionInfo.executablePath +--- + +# BrowserFetcherRevisionInfo.executablePath property + +**Signature:** + +```typescript +interface BrowserFetcherRevisionInfo { + executablePath: string; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcherrevisioninfo.folderpath.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcherrevisioninfo.folderpath.md new file mode 100644 index 00000000000..afaa567cc44 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcherrevisioninfo.folderpath.md @@ -0,0 +1,13 @@ +--- +sidebar_label: BrowserFetcherRevisionInfo.folderPath +--- + +# BrowserFetcherRevisionInfo.folderPath property + +**Signature:** + +```typescript +interface BrowserFetcherRevisionInfo { + folderPath: string; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcherrevisioninfo.local.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcherrevisioninfo.local.md new file mode 100644 index 00000000000..78aebaefb21 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcherrevisioninfo.local.md @@ -0,0 +1,13 @@ +--- +sidebar_label: BrowserFetcherRevisionInfo.local +--- + +# BrowserFetcherRevisionInfo.local property + +**Signature:** + +```typescript +interface BrowserFetcherRevisionInfo { + local: boolean; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcherrevisioninfo.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcherrevisioninfo.md new file mode 100644 index 00000000000..feb82cc965f --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcherrevisioninfo.md @@ -0,0 +1,22 @@ +--- +sidebar_label: BrowserFetcherRevisionInfo +--- + +# BrowserFetcherRevisionInfo interface + +**Signature:** + +```typescript +export interface BrowserFetcherRevisionInfo +``` + +## Properties + +| Property | Modifiers | Type | Description | +| -------------------------------------------------------------------------- | --------- | ------- | ----------- | +| [executablePath](./puppeteer.browserfetcherrevisioninfo.executablepath.md) | | string | | +| [folderPath](./puppeteer.browserfetcherrevisioninfo.folderpath.md) | | string | | +| [local](./puppeteer.browserfetcherrevisioninfo.local.md) | | boolean | | +| [product](./puppeteer.browserfetcherrevisioninfo.product.md) | | string | | +| [revision](./puppeteer.browserfetcherrevisioninfo.revision.md) | | string | | +| [url](./puppeteer.browserfetcherrevisioninfo.url.md) | | string | | diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcherrevisioninfo.product.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcherrevisioninfo.product.md new file mode 100644 index 00000000000..d7a0952c1bd --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcherrevisioninfo.product.md @@ -0,0 +1,13 @@ +--- +sidebar_label: BrowserFetcherRevisionInfo.product +--- + +# BrowserFetcherRevisionInfo.product property + +**Signature:** + +```typescript +interface BrowserFetcherRevisionInfo { + product: string; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcherrevisioninfo.revision.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcherrevisioninfo.revision.md new file mode 100644 index 00000000000..c9a6239011e --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcherrevisioninfo.revision.md @@ -0,0 +1,13 @@ +--- +sidebar_label: BrowserFetcherRevisionInfo.revision +--- + +# BrowserFetcherRevisionInfo.revision property + +**Signature:** + +```typescript +interface BrowserFetcherRevisionInfo { + revision: string; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcherrevisioninfo.url.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcherrevisioninfo.url.md new file mode 100644 index 00000000000..308523614be --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browserfetcherrevisioninfo.url.md @@ -0,0 +1,13 @@ +--- +sidebar_label: BrowserFetcherRevisionInfo.url +--- + +# BrowserFetcherRevisionInfo.url property + +**Signature:** + +```typescript +interface BrowserFetcherRevisionInfo { + url: string; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browserlaunchargumentoptions.args.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browserlaunchargumentoptions.args.md new file mode 100644 index 00000000000..a5ab226a078 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browserlaunchargumentoptions.args.md @@ -0,0 +1,15 @@ +--- +sidebar_label: BrowserLaunchArgumentOptions.args +--- + +# BrowserLaunchArgumentOptions.args property + +Additional command line arguments to pass to the browser instance. + +**Signature:** + +```typescript +interface BrowserLaunchArgumentOptions { + args?: string[]; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browserlaunchargumentoptions.debuggingport.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browserlaunchargumentoptions.debuggingport.md new file mode 100644 index 00000000000..8cae9b31cf7 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browserlaunchargumentoptions.debuggingport.md @@ -0,0 +1,13 @@ +--- +sidebar_label: BrowserLaunchArgumentOptions.debuggingPort +--- + +# BrowserLaunchArgumentOptions.debuggingPort property + +**Signature:** + +```typescript +interface BrowserLaunchArgumentOptions { + debuggingPort?: number; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browserlaunchargumentoptions.devtools.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browserlaunchargumentoptions.devtools.md new file mode 100644 index 00000000000..4459ff0d65f --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browserlaunchargumentoptions.devtools.md @@ -0,0 +1,15 @@ +--- +sidebar_label: BrowserLaunchArgumentOptions.devtools +--- + +# BrowserLaunchArgumentOptions.devtools property + +Whether to auto-open a DevTools panel for each tab. If this is set to `true`, then `headless` will be forced to `false`. + +**Signature:** + +```typescript +interface BrowserLaunchArgumentOptions { + devtools?: boolean; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browserlaunchargumentoptions.headless.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browserlaunchargumentoptions.headless.md new file mode 100644 index 00000000000..2a090d09f3b --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browserlaunchargumentoptions.headless.md @@ -0,0 +1,15 @@ +--- +sidebar_label: BrowserLaunchArgumentOptions.headless +--- + +# BrowserLaunchArgumentOptions.headless property + +Whether to run the browser in headless mode. + +**Signature:** + +```typescript +interface BrowserLaunchArgumentOptions { + headless?: boolean | 'chrome'; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browserlaunchargumentoptions.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browserlaunchargumentoptions.md new file mode 100644 index 00000000000..ee56708fd58 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browserlaunchargumentoptions.md @@ -0,0 +1,23 @@ +--- +sidebar_label: BrowserLaunchArgumentOptions +--- + +# BrowserLaunchArgumentOptions interface + +Launcher options that only apply to Chrome. + +**Signature:** + +```typescript +export interface BrowserLaunchArgumentOptions +``` + +## Properties + +| Property | Modifiers | Type | Description | +| --------------------------------------------------------------------------- | --------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [args?](./puppeteer.browserlaunchargumentoptions.args.md) | | string\[\] | (Optional) Additional command line arguments to pass to the browser instance. | +| [debuggingPort?](./puppeteer.browserlaunchargumentoptions.debuggingport.md) | | number | (Optional) | +| [devtools?](./puppeteer.browserlaunchargumentoptions.devtools.md) | | boolean | (Optional) Whether to auto-open a DevTools panel for each tab. If this is set to true, then headless will be forced to false. | +| [headless?](./puppeteer.browserlaunchargumentoptions.headless.md) | | boolean \| 'chrome' | (Optional) Whether to run the browser in headless mode. | +| [userDataDir?](./puppeteer.browserlaunchargumentoptions.userdatadir.md) | | string | (Optional) 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. | diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.browserlaunchargumentoptions.userdatadir.md b/website/versioned_docs/version-16.0.0/api/puppeteer.browserlaunchargumentoptions.userdatadir.md new file mode 100644 index 00000000000..ca039914677 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.browserlaunchargumentoptions.userdatadir.md @@ -0,0 +1,15 @@ +--- +sidebar_label: BrowserLaunchArgumentOptions.userDataDir +--- + +# BrowserLaunchArgumentOptions.userDataDir property + +Path to a user data directory. [see the Chromium docs](https://chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/user_data_dir.md) for more info. + +**Signature:** + +```typescript +interface BrowserLaunchArgumentOptions { + userDataDir?: string; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.cdpsession.connection.md b/website/versioned_docs/version-16.0.0/api/puppeteer.cdpsession.connection.md new file mode 100644 index 00000000000..e05b5f6d9f9 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.cdpsession.connection.md @@ -0,0 +1,17 @@ +--- +sidebar_label: CDPSession.connection +--- + +# CDPSession.connection() method + +**Signature:** + +```typescript +class CDPSession { + connection(): Connection | undefined; +} +``` + +**Returns:** + +[Connection](./puppeteer.connection.md) \| undefined diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.cdpsession.detach.md b/website/versioned_docs/version-16.0.0/api/puppeteer.cdpsession.detach.md new file mode 100644 index 00000000000..e153ba2e7a5 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.cdpsession.detach.md @@ -0,0 +1,19 @@ +--- +sidebar_label: CDPSession.detach +--- + +# CDPSession.detach() method + +Detaches the cdpSession from the target. Once detached, the cdpSession object won't emit any events and can't be used to send messages. + +**Signature:** + +```typescript +class CDPSession { + detach(): Promise; +} +``` + +**Returns:** + +Promise<void> diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.cdpsession.id.md b/website/versioned_docs/version-16.0.0/api/puppeteer.cdpsession.id.md new file mode 100644 index 00000000000..6b28e780647 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.cdpsession.id.md @@ -0,0 +1,19 @@ +--- +sidebar_label: CDPSession.id +--- + +# CDPSession.id() method + +Returns the session's id. + +**Signature:** + +```typescript +class CDPSession { + id(): string; +} +``` + +**Returns:** + +string diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.cdpsession.md b/website/versioned_docs/version-16.0.0/api/puppeteer.cdpsession.md new file mode 100644 index 00000000000..28e37731b06 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.cdpsession.md @@ -0,0 +1,47 @@ +--- +sidebar_label: CDPSession +--- + +# CDPSession class + +The `CDPSession` instances are used to talk raw Chrome Devtools Protocol. + +**Signature:** + +```typescript +export declare class CDPSession extends EventEmitter +``` + +**Extends:** [EventEmitter](./puppeteer.eventemitter.md) + +## Remarks + +Protocol methods can be called with [CDPSession.send()](./puppeteer.cdpsession.send.md) method and protocol events can be subscribed to with `CDPSession.on` method. + +Useful links: [DevTools Protocol Viewer](https://chromedevtools.github.io/devtools-protocol/) and [Getting Started with DevTools Protocol](https://github.com/aslushnikov/getting-started-with-cdp/blob/HEAD/README.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 `CDPSession` class. + +## Example + +```ts +const client = await page.target().createCDPSession(); +await client.send('Animation.enable'); +client.on('Animation.animationCreated', () => + console.log('Animation created!') +); +const response = await client.send('Animation.getPlaybackRate'); +console.log('playback rate is ' + response.playbackRate); +await client.send('Animation.setPlaybackRate', { + playbackRate: response.playbackRate / 2, +}); +``` + +## Methods + +| Method | Modifiers | Description | +| --------------------------------------------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------- | +| [connection()](./puppeteer.cdpsession.connection.md) | | | +| [detach()](./puppeteer.cdpsession.detach.md) | | Detaches the cdpSession from the target. Once detached, the cdpSession object won't emit any events and can't be used to send messages. | +| [id()](./puppeteer.cdpsession.id.md) | | Returns the session's id. | +| [send(method, paramArgs)](./puppeteer.cdpsession.send.md) | | | diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.cdpsession.send.md b/website/versioned_docs/version-16.0.0/api/puppeteer.cdpsession.send.md new file mode 100644 index 00000000000..5fbe00c6bf3 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.cdpsession.send.md @@ -0,0 +1,27 @@ +--- +sidebar_label: CDPSession.send +--- + +# CDPSession.send() method + +**Signature:** + +```typescript +class CDPSession { + send( + method: T, + ...paramArgs: ProtocolMapping.Commands[T]['paramsType'] + ): Promise; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | --------------------------------------------- | ----------- | +| method | T | | +| paramArgs | ProtocolMapping.Commands\[T\]\['paramsType'\] | | + +**Returns:** + +Promise<ProtocolMapping.Commands\[T\]\['returnType'\]> diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.cdpsessiononmessageobject.error.md b/website/versioned_docs/version-16.0.0/api/puppeteer.cdpsessiononmessageobject.error.md new file mode 100644 index 00000000000..72697d96b05 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.cdpsessiononmessageobject.error.md @@ -0,0 +1,17 @@ +--- +sidebar_label: CDPSessionOnMessageObject.error +--- + +# CDPSessionOnMessageObject.error property + +**Signature:** + +```typescript +interface CDPSessionOnMessageObject { + error: { + message: string; + data: any; + code: number; + }; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.cdpsessiononmessageobject.id.md b/website/versioned_docs/version-16.0.0/api/puppeteer.cdpsessiononmessageobject.id.md new file mode 100644 index 00000000000..6b2b14aab49 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.cdpsessiononmessageobject.id.md @@ -0,0 +1,13 @@ +--- +sidebar_label: CDPSessionOnMessageObject.id +--- + +# CDPSessionOnMessageObject.id property + +**Signature:** + +```typescript +interface CDPSessionOnMessageObject { + id?: number; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.cdpsessiononmessageobject.md b/website/versioned_docs/version-16.0.0/api/puppeteer.cdpsessiononmessageobject.md new file mode 100644 index 00000000000..f3ec87b0373 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.cdpsessiononmessageobject.md @@ -0,0 +1,21 @@ +--- +sidebar_label: CDPSessionOnMessageObject +--- + +# CDPSessionOnMessageObject interface + +**Signature:** + +```typescript +export interface CDPSessionOnMessageObject +``` + +## Properties + +| Property | Modifiers | Type | Description | +| ---------------------------------------------------------- | --------- | --------------------------------------------- | ----------------- | +| [error](./puppeteer.cdpsessiononmessageobject.error.md) | | { message: string; data: any; code: number; } | | +| [id?](./puppeteer.cdpsessiononmessageobject.id.md) | | number | (Optional) | +| [method](./puppeteer.cdpsessiononmessageobject.method.md) | | string | | +| [params](./puppeteer.cdpsessiononmessageobject.params.md) | | Record<string, unknown> | | +| [result?](./puppeteer.cdpsessiononmessageobject.result.md) | | any | (Optional) | diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.cdpsessiononmessageobject.method.md b/website/versioned_docs/version-16.0.0/api/puppeteer.cdpsessiononmessageobject.method.md new file mode 100644 index 00000000000..04d9e897b7e --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.cdpsessiononmessageobject.method.md @@ -0,0 +1,13 @@ +--- +sidebar_label: CDPSessionOnMessageObject.method +--- + +# CDPSessionOnMessageObject.method property + +**Signature:** + +```typescript +interface CDPSessionOnMessageObject { + method: string; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.cdpsessiononmessageobject.params.md b/website/versioned_docs/version-16.0.0/api/puppeteer.cdpsessiononmessageobject.params.md new file mode 100644 index 00000000000..ab7f84bba89 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.cdpsessiononmessageobject.params.md @@ -0,0 +1,13 @@ +--- +sidebar_label: CDPSessionOnMessageObject.params +--- + +# CDPSessionOnMessageObject.params property + +**Signature:** + +```typescript +interface CDPSessionOnMessageObject { + params: Record; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.cdpsessiononmessageobject.result.md b/website/versioned_docs/version-16.0.0/api/puppeteer.cdpsessiononmessageobject.result.md new file mode 100644 index 00000000000..7097bdff4f2 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.cdpsessiononmessageobject.result.md @@ -0,0 +1,13 @@ +--- +sidebar_label: CDPSessionOnMessageObject.result +--- + +# CDPSessionOnMessageObject.result property + +**Signature:** + +```typescript +interface CDPSessionOnMessageObject { + result?: any; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.chromereleasechannel.md b/website/versioned_docs/version-16.0.0/api/puppeteer.chromereleasechannel.md new file mode 100644 index 00000000000..3021c39d49e --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.chromereleasechannel.md @@ -0,0 +1,15 @@ +--- +sidebar_label: ChromeReleaseChannel +--- + +# ChromeReleaseChannel type + +**Signature:** + +```typescript +export declare type ChromeReleaseChannel = + | 'chrome' + | 'chrome-beta' + | 'chrome-canary' + | 'chrome-dev'; +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.clearcustomqueryhandlers.md b/website/versioned_docs/version-16.0.0/api/puppeteer.clearcustomqueryhandlers.md new file mode 100644 index 00000000000..8dcf2c26067 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.clearcustomqueryhandlers.md @@ -0,0 +1,17 @@ +--- +sidebar_label: clearCustomQueryHandlers +--- + +# clearCustomQueryHandlers() function + +Clears all registered handlers. + +**Signature:** + +```typescript +export declare function clearCustomQueryHandlers(): void; +``` + +**Returns:** + +void diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.clickoptions.button.md b/website/versioned_docs/version-16.0.0/api/puppeteer.clickoptions.button.md new file mode 100644 index 00000000000..38f90a938b7 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.clickoptions.button.md @@ -0,0 +1,13 @@ +--- +sidebar_label: ClickOptions.button +--- + +# ClickOptions.button property + +**Signature:** + +```typescript +interface ClickOptions { + button?: MouseButton; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.clickoptions.clickcount.md b/website/versioned_docs/version-16.0.0/api/puppeteer.clickoptions.clickcount.md new file mode 100644 index 00000000000..fd60641930b --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.clickoptions.clickcount.md @@ -0,0 +1,13 @@ +--- +sidebar_label: ClickOptions.clickCount +--- + +# ClickOptions.clickCount property + +**Signature:** + +```typescript +interface ClickOptions { + clickCount?: number; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.clickoptions.delay.md b/website/versioned_docs/version-16.0.0/api/puppeteer.clickoptions.delay.md new file mode 100644 index 00000000000..cac255d8af5 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.clickoptions.delay.md @@ -0,0 +1,15 @@ +--- +sidebar_label: ClickOptions.delay +--- + +# ClickOptions.delay property + +Time to wait between `mousedown` and `mouseup` in milliseconds. + +**Signature:** + +```typescript +interface ClickOptions { + delay?: number; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.clickoptions.md b/website/versioned_docs/version-16.0.0/api/puppeteer.clickoptions.md new file mode 100644 index 00000000000..bc0f0c16da6 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.clickoptions.md @@ -0,0 +1,20 @@ +--- +sidebar_label: ClickOptions +--- + +# ClickOptions interface + +**Signature:** + +```typescript +export interface ClickOptions +``` + +## Properties + +| Property | Modifiers | Type | Description | +| ----------------------------------------------------- | --------- | ----------------------------------------- | ------------------------------------------------------------------------------------------------------- | +| [button?](./puppeteer.clickoptions.button.md) | | [MouseButton](./puppeteer.mousebutton.md) | (Optional) | +| [clickCount?](./puppeteer.clickoptions.clickcount.md) | | number | (Optional) | +| [delay?](./puppeteer.clickoptions.delay.md) | | number | (Optional) Time to wait between mousedown and mouseup in milliseconds. | +| [offset?](./puppeteer.clickoptions.offset.md) | | [Offset](./puppeteer.offset.md) | (Optional) Offset for the clickable point relative to the top-left corder of the border box. | diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.clickoptions.offset.md b/website/versioned_docs/version-16.0.0/api/puppeteer.clickoptions.offset.md new file mode 100644 index 00000000000..40bd871040a --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.clickoptions.offset.md @@ -0,0 +1,15 @@ +--- +sidebar_label: ClickOptions.offset +--- + +# ClickOptions.offset property + +Offset for the clickable point relative to the top-left corder of the border box. + +**Signature:** + +```typescript +interface ClickOptions { + offset?: Offset; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.commoneventemitter.addlistener.md b/website/versioned_docs/version-16.0.0/api/puppeteer.commoneventemitter.addlistener.md new file mode 100644 index 00000000000..021b4bf8fdc --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.commoneventemitter.addlistener.md @@ -0,0 +1,24 @@ +--- +sidebar_label: CommonEventEmitter.addListener +--- + +# CommonEventEmitter.addListener() method + +**Signature:** + +```typescript +interface CommonEventEmitter { + addListener(event: EventType, handler: Handler): CommonEventEmitter; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ------------------------------------- | ----------- | +| event | [EventType](./puppeteer.eventtype.md) | | +| handler | [Handler](./puppeteer.handler.md) | | + +**Returns:** + +[CommonEventEmitter](./puppeteer.commoneventemitter.md) diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.commoneventemitter.emit.md b/website/versioned_docs/version-16.0.0/api/puppeteer.commoneventemitter.emit.md new file mode 100644 index 00000000000..631d6f7fb38 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.commoneventemitter.emit.md @@ -0,0 +1,24 @@ +--- +sidebar_label: CommonEventEmitter.emit +--- + +# CommonEventEmitter.emit() method + +**Signature:** + +```typescript +interface CommonEventEmitter { + emit(event: EventType, eventData?: unknown): boolean; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ------------------------------------- | ----------------- | +| event | [EventType](./puppeteer.eventtype.md) | | +| eventData | unknown | (Optional) | + +**Returns:** + +boolean diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.commoneventemitter.listenercount.md b/website/versioned_docs/version-16.0.0/api/puppeteer.commoneventemitter.listenercount.md new file mode 100644 index 00000000000..fe4fdfccc61 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.commoneventemitter.listenercount.md @@ -0,0 +1,23 @@ +--- +sidebar_label: CommonEventEmitter.listenerCount +--- + +# CommonEventEmitter.listenerCount() method + +**Signature:** + +```typescript +interface CommonEventEmitter { + listenerCount(event: string): number; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ------ | ----------- | +| event | string | | + +**Returns:** + +number diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.commoneventemitter.md b/website/versioned_docs/version-16.0.0/api/puppeteer.commoneventemitter.md new file mode 100644 index 00000000000..c3b8072996b --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.commoneventemitter.md @@ -0,0 +1,24 @@ +--- +sidebar_label: CommonEventEmitter +--- + +# CommonEventEmitter interface + +**Signature:** + +```typescript +export interface CommonEventEmitter +``` + +## Methods + +| Method | Description | +| ---------------------------------------------------------------------------------- | ----------- | +| [addListener(event, handler)](./puppeteer.commoneventemitter.addlistener.md) | | +| [emit(event, eventData)](./puppeteer.commoneventemitter.emit.md) | | +| [listenerCount(event)](./puppeteer.commoneventemitter.listenercount.md) | | +| [off(event, handler)](./puppeteer.commoneventemitter.off.md) | | +| [on(event, handler)](./puppeteer.commoneventemitter.on.md) | | +| [once(event, handler)](./puppeteer.commoneventemitter.once.md) | | +| [removeAllListeners(event)](./puppeteer.commoneventemitter.removealllisteners.md) | | +| [removeListener(event, handler)](./puppeteer.commoneventemitter.removelistener.md) | | diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.commoneventemitter.off.md b/website/versioned_docs/version-16.0.0/api/puppeteer.commoneventemitter.off.md new file mode 100644 index 00000000000..f9f361563fd --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.commoneventemitter.off.md @@ -0,0 +1,24 @@ +--- +sidebar_label: CommonEventEmitter.off +--- + +# CommonEventEmitter.off() method + +**Signature:** + +```typescript +interface CommonEventEmitter { + off(event: EventType, handler: Handler): CommonEventEmitter; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ------------------------------------- | ----------- | +| event | [EventType](./puppeteer.eventtype.md) | | +| handler | [Handler](./puppeteer.handler.md) | | + +**Returns:** + +[CommonEventEmitter](./puppeteer.commoneventemitter.md) diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.commoneventemitter.on.md b/website/versioned_docs/version-16.0.0/api/puppeteer.commoneventemitter.on.md new file mode 100644 index 00000000000..bd2c4dff685 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.commoneventemitter.on.md @@ -0,0 +1,24 @@ +--- +sidebar_label: CommonEventEmitter.on +--- + +# CommonEventEmitter.on() method + +**Signature:** + +```typescript +interface CommonEventEmitter { + on(event: EventType, handler: Handler): CommonEventEmitter; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ------------------------------------- | ----------- | +| event | [EventType](./puppeteer.eventtype.md) | | +| handler | [Handler](./puppeteer.handler.md) | | + +**Returns:** + +[CommonEventEmitter](./puppeteer.commoneventemitter.md) diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.commoneventemitter.once.md b/website/versioned_docs/version-16.0.0/api/puppeteer.commoneventemitter.once.md new file mode 100644 index 00000000000..ec8ce3bdf7f --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.commoneventemitter.once.md @@ -0,0 +1,24 @@ +--- +sidebar_label: CommonEventEmitter.once +--- + +# CommonEventEmitter.once() method + +**Signature:** + +```typescript +interface CommonEventEmitter { + once(event: EventType, handler: Handler): CommonEventEmitter; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ------------------------------------- | ----------- | +| event | [EventType](./puppeteer.eventtype.md) | | +| handler | [Handler](./puppeteer.handler.md) | | + +**Returns:** + +[CommonEventEmitter](./puppeteer.commoneventemitter.md) diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.commoneventemitter.removealllisteners.md b/website/versioned_docs/version-16.0.0/api/puppeteer.commoneventemitter.removealllisteners.md new file mode 100644 index 00000000000..ae57713078c --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.commoneventemitter.removealllisteners.md @@ -0,0 +1,23 @@ +--- +sidebar_label: CommonEventEmitter.removeAllListeners +--- + +# CommonEventEmitter.removeAllListeners() method + +**Signature:** + +```typescript +interface CommonEventEmitter { + removeAllListeners(event?: EventType): CommonEventEmitter; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ------------------------------------- | ----------------- | +| event | [EventType](./puppeteer.eventtype.md) | (Optional) | + +**Returns:** + +[CommonEventEmitter](./puppeteer.commoneventemitter.md) diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.commoneventemitter.removelistener.md b/website/versioned_docs/version-16.0.0/api/puppeteer.commoneventemitter.removelistener.md new file mode 100644 index 00000000000..fab78044224 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.commoneventemitter.removelistener.md @@ -0,0 +1,24 @@ +--- +sidebar_label: CommonEventEmitter.removeListener +--- + +# CommonEventEmitter.removeListener() method + +**Signature:** + +```typescript +interface CommonEventEmitter { + removeListener(event: EventType, handler: Handler): CommonEventEmitter; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ------------------------------------- | ----------- | +| event | [EventType](./puppeteer.eventtype.md) | | +| handler | [Handler](./puppeteer.handler.md) | | + +**Returns:** + +[CommonEventEmitter](./puppeteer.commoneventemitter.md) diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.connect.md b/website/versioned_docs/version-16.0.0/api/puppeteer.connect.md new file mode 100644 index 00000000000..9201297ab5c --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.connect.md @@ -0,0 +1,11 @@ +--- +sidebar_label: connect +--- + +# connect variable + +**Signature:** + +```typescript +connect: (options: import("./types.js").ConnectOptions) => Promise +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.connection._constructor_.md b/website/versioned_docs/version-16.0.0/api/puppeteer.connection._constructor_.md new file mode 100644 index 00000000000..c2d54bf4a78 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.connection._constructor_.md @@ -0,0 +1,23 @@ +--- +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); +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | --------------------------------------------------------- | ----------------- | +| url | string | | +| transport | [ConnectionTransport](./puppeteer.connectiontransport.md) | | +| delay | number | (Optional) | diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.connection.createsession.md b/website/versioned_docs/version-16.0.0/api/puppeteer.connection.createsession.md new file mode 100644 index 00000000000..f59974a1a91 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.connection.createsession.md @@ -0,0 +1,25 @@ +--- +sidebar_label: Connection.createSession +--- + +# Connection.createSession() method + +**Signature:** + +```typescript +class Connection { + createSession(targetInfo: Protocol.Target.TargetInfo): Promise; +} +``` + +## Parameters + +| Parameter | Type | Description | +| ---------- | -------------------------- | --------------- | +| targetInfo | Protocol.Target.TargetInfo | The target info | + +**Returns:** + +Promise<[CDPSession](./puppeteer.cdpsession.md)> + +The CDP session that is created diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.connection.dispose.md b/website/versioned_docs/version-16.0.0/api/puppeteer.connection.dispose.md new file mode 100644 index 00000000000..9e8759482b1 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.connection.dispose.md @@ -0,0 +1,17 @@ +--- +sidebar_label: Connection.dispose +--- + +# Connection.dispose() method + +**Signature:** + +```typescript +class Connection { + dispose(): void; +} +``` + +**Returns:** + +void diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.connection.fromsession.md b/website/versioned_docs/version-16.0.0/api/puppeteer.connection.fromsession.md new file mode 100644 index 00000000000..c69aad31d02 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.connection.fromsession.md @@ -0,0 +1,23 @@ +--- +sidebar_label: Connection.fromSession +--- + +# Connection.fromSession() method + +**Signature:** + +```typescript +class Connection { + static fromSession(session: CDPSession): Connection | undefined; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | --------------------------------------- | ----------- | +| session | [CDPSession](./puppeteer.cdpsession.md) | | + +**Returns:** + +[Connection](./puppeteer.connection.md) \| undefined diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.connection.md b/website/versioned_docs/version-16.0.0/api/puppeteer.connection.md new file mode 100644 index 00000000000..4e64fb7ad19 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.connection.md @@ -0,0 +1,30 @@ +--- +sidebar_label: Connection +--- + +# Connection class + +**Signature:** + +```typescript +export declare class Connection extends EventEmitter +``` + +**Extends:** [EventEmitter](./puppeteer.eventemitter.md) + +## Constructors + +| Constructor | Modifiers | Description | +| ------------------------------------------------------------------------------- | --------- | -------------------------------------------------------------- | +| [(constructor)(url, transport, delay)](./puppeteer.connection._constructor_.md) | | Constructs a new instance of the Connection class | + +## Methods + +| Method | Modifiers | Description | +| -------------------------------------------------------------------- | ------------------- | ----------- | +| [createSession(targetInfo)](./puppeteer.connection.createsession.md) | | | +| [dispose()](./puppeteer.connection.dispose.md) | | | +| [fromSession(session)](./puppeteer.connection.fromsession.md) | static | | +| [send(method, paramArgs)](./puppeteer.connection.send.md) | | | +| [session(sessionId)](./puppeteer.connection.session.md) | | | +| [url()](./puppeteer.connection.url.md) | | | diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.connection.send.md b/website/versioned_docs/version-16.0.0/api/puppeteer.connection.send.md new file mode 100644 index 00000000000..6bbfae9455a --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.connection.send.md @@ -0,0 +1,27 @@ +--- +sidebar_label: Connection.send +--- + +# Connection.send() method + +**Signature:** + +```typescript +class Connection { + send( + method: T, + ...paramArgs: ProtocolMapping.Commands[T]['paramsType'] + ): Promise; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | --------------------------------------------- | ----------- | +| method | T | | +| paramArgs | ProtocolMapping.Commands\[T\]\['paramsType'\] | | + +**Returns:** + +Promise<ProtocolMapping.Commands\[T\]\['returnType'\]> diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.connection.session.md b/website/versioned_docs/version-16.0.0/api/puppeteer.connection.session.md new file mode 100644 index 00000000000..f047ca981b6 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.connection.session.md @@ -0,0 +1,25 @@ +--- +sidebar_label: Connection.session +--- + +# Connection.session() method + +**Signature:** + +```typescript +class Connection { + session(sessionId: string): CDPSession | null; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ------ | -------------- | +| sessionId | string | The session id | + +**Returns:** + +[CDPSession](./puppeteer.cdpsession.md) \| null + +The current CDP session if it exists diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.connection.url.md b/website/versioned_docs/version-16.0.0/api/puppeteer.connection.url.md new file mode 100644 index 00000000000..34798c2c444 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.connection.url.md @@ -0,0 +1,17 @@ +--- +sidebar_label: Connection.url +--- + +# Connection.url() method + +**Signature:** + +```typescript +class Connection { + url(): string; +} +``` + +**Returns:** + +string diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.connectioncallback.error.md b/website/versioned_docs/version-16.0.0/api/puppeteer.connectioncallback.error.md new file mode 100644 index 00000000000..584c0ca9ead --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.connectioncallback.error.md @@ -0,0 +1,13 @@ +--- +sidebar_label: ConnectionCallback.error +--- + +# ConnectionCallback.error property + +**Signature:** + +```typescript +interface ConnectionCallback { + error: ProtocolError; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.connectioncallback.md b/website/versioned_docs/version-16.0.0/api/puppeteer.connectioncallback.md new file mode 100644 index 00000000000..fc82eff2d74 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.connectioncallback.md @@ -0,0 +1,25 @@ +--- +sidebar_label: ConnectionCallback +--- + +# ConnectionCallback interface + +**Signature:** + +```typescript +export interface ConnectionCallback +``` + +## Properties + +| Property | Modifiers | Type | Description | +| -------------------------------------------------- | --------- | --------------------------------------------- | ----------- | +| [error](./puppeteer.connectioncallback.error.md) | | [ProtocolError](./puppeteer.protocolerror.md) | | +| [method](./puppeteer.connectioncallback.method.md) | | string | | + +## Methods + +| Method | Description | +| ---------------------------------------------------------- | ----------- | +| [reject(args)](./puppeteer.connectioncallback.reject.md) | | +| [resolve(args)](./puppeteer.connectioncallback.resolve.md) | | diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.connectioncallback.method.md b/website/versioned_docs/version-16.0.0/api/puppeteer.connectioncallback.method.md new file mode 100644 index 00000000000..f30bb6095d0 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.connectioncallback.method.md @@ -0,0 +1,13 @@ +--- +sidebar_label: ConnectionCallback.method +--- + +# ConnectionCallback.method property + +**Signature:** + +```typescript +interface ConnectionCallback { + method: string; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.connectioncallback.reject.md b/website/versioned_docs/version-16.0.0/api/puppeteer.connectioncallback.reject.md new file mode 100644 index 00000000000..47a44bf4dab --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.connectioncallback.reject.md @@ -0,0 +1,23 @@ +--- +sidebar_label: ConnectionCallback.reject +--- + +# ConnectionCallback.reject() method + +**Signature:** + +```typescript +interface ConnectionCallback { + reject(args: unknown): void; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ------- | ----------- | +| args | unknown | | + +**Returns:** + +void diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.connectioncallback.resolve.md b/website/versioned_docs/version-16.0.0/api/puppeteer.connectioncallback.resolve.md new file mode 100644 index 00000000000..07e1aee38ce --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.connectioncallback.resolve.md @@ -0,0 +1,23 @@ +--- +sidebar_label: ConnectionCallback.resolve +--- + +# ConnectionCallback.resolve() method + +**Signature:** + +```typescript +interface ConnectionCallback { + resolve(args: unknown): void; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ------- | ----------- | +| args | unknown | | + +**Returns:** + +void diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.connectiontransport.close.md b/website/versioned_docs/version-16.0.0/api/puppeteer.connectiontransport.close.md new file mode 100644 index 00000000000..964ee5997c5 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.connectiontransport.close.md @@ -0,0 +1,17 @@ +--- +sidebar_label: ConnectionTransport.close +--- + +# ConnectionTransport.close() method + +**Signature:** + +```typescript +interface ConnectionTransport { + close(): void; +} +``` + +**Returns:** + +void diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.connectiontransport.md b/website/versioned_docs/version-16.0.0/api/puppeteer.connectiontransport.md new file mode 100644 index 00000000000..761a15fbc11 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.connectiontransport.md @@ -0,0 +1,25 @@ +--- +sidebar_label: ConnectionTransport +--- + +# ConnectionTransport interface + +**Signature:** + +```typescript +export interface ConnectionTransport +``` + +## Properties + +| Property | Modifiers | Type | Description | +| ---------------------------------------------------------- | --------- | ---------------------------- | ----------------- | +| [onclose?](./puppeteer.connectiontransport.onclose.md) | | () => void | (Optional) | +| [onmessage?](./puppeteer.connectiontransport.onmessage.md) | | (message: string) => void | (Optional) | + +## Methods + +| Method | Description | +| -------------------------------------------------------- | ----------- | +| [close()](./puppeteer.connectiontransport.close.md) | | +| [send(message)](./puppeteer.connectiontransport.send.md) | | diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.connectiontransport.onclose.md b/website/versioned_docs/version-16.0.0/api/puppeteer.connectiontransport.onclose.md new file mode 100644 index 00000000000..1bda6671530 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.connectiontransport.onclose.md @@ -0,0 +1,13 @@ +--- +sidebar_label: ConnectionTransport.onclose +--- + +# ConnectionTransport.onclose property + +**Signature:** + +```typescript +interface ConnectionTransport { + onclose?: () => void; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.connectiontransport.onmessage.md b/website/versioned_docs/version-16.0.0/api/puppeteer.connectiontransport.onmessage.md new file mode 100644 index 00000000000..c85de25d7b0 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.connectiontransport.onmessage.md @@ -0,0 +1,13 @@ +--- +sidebar_label: ConnectionTransport.onmessage +--- + +# ConnectionTransport.onmessage property + +**Signature:** + +```typescript +interface ConnectionTransport { + onmessage?: (message: string) => void; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.connectiontransport.send.md b/website/versioned_docs/version-16.0.0/api/puppeteer.connectiontransport.send.md new file mode 100644 index 00000000000..60ddf8fb72e --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.connectiontransport.send.md @@ -0,0 +1,23 @@ +--- +sidebar_label: ConnectionTransport.send +--- + +# ConnectionTransport.send() method + +**Signature:** + +```typescript +interface ConnectionTransport { + send(message: string): void; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ------ | ----------- | +| message | string | | + +**Returns:** + +void diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.connectoptions.browserurl.md b/website/versioned_docs/version-16.0.0/api/puppeteer.connectoptions.browserurl.md new file mode 100644 index 00000000000..0c16cc5c677 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.connectoptions.browserurl.md @@ -0,0 +1,13 @@ +--- +sidebar_label: ConnectOptions.browserURL +--- + +# ConnectOptions.browserURL property + +**Signature:** + +```typescript +interface ConnectOptions { + browserURL?: string; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.connectoptions.browserwsendpoint.md b/website/versioned_docs/version-16.0.0/api/puppeteer.connectoptions.browserwsendpoint.md new file mode 100644 index 00000000000..80374e2f257 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.connectoptions.browserwsendpoint.md @@ -0,0 +1,13 @@ +--- +sidebar_label: ConnectOptions.browserWSEndpoint +--- + +# ConnectOptions.browserWSEndpoint property + +**Signature:** + +```typescript +interface ConnectOptions { + browserWSEndpoint?: string; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.connectoptions.md b/website/versioned_docs/version-16.0.0/api/puppeteer.connectoptions.md new file mode 100644 index 00000000000..fa3b691afc7 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.connectoptions.md @@ -0,0 +1,21 @@ +--- +sidebar_label: ConnectOptions +--- + +# ConnectOptions interface + +**Signature:** + +```typescript +export interface ConnectOptions extends BrowserConnectOptions +``` + +**Extends:** [BrowserConnectOptions](./puppeteer.browserconnectoptions.md) + +## Properties + +| Property | Modifiers | Type | Description | +| --------------------------------------------------------------------- | --------- | --------------------------------------------------------- | ----------------- | +| [browserURL?](./puppeteer.connectoptions.browserurl.md) | | string | (Optional) | +| [browserWSEndpoint?](./puppeteer.connectoptions.browserwsendpoint.md) | | string | (Optional) | +| [transport?](./puppeteer.connectoptions.transport.md) | | [ConnectionTransport](./puppeteer.connectiontransport.md) | (Optional) | diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.connectoptions.transport.md b/website/versioned_docs/version-16.0.0/api/puppeteer.connectoptions.transport.md new file mode 100644 index 00000000000..d3faf62883d --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.connectoptions.transport.md @@ -0,0 +1,13 @@ +--- +sidebar_label: ConnectOptions.transport +--- + +# ConnectOptions.transport property + +**Signature:** + +```typescript +interface ConnectOptions { + transport?: ConnectionTransport; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.consolemessage._constructor_.md b/website/versioned_docs/version-16.0.0/api/puppeteer.consolemessage._constructor_.md new file mode 100644 index 00000000000..4614d2bed50 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.consolemessage._constructor_.md @@ -0,0 +1,29 @@ +--- +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)\[\] | | diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.consolemessage.args.md b/website/versioned_docs/version-16.0.0/api/puppeteer.consolemessage.args.md new file mode 100644 index 00000000000..20400631772 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.consolemessage.args.md @@ -0,0 +1,19 @@ +--- +sidebar_label: ConsoleMessage.args +--- + +# ConsoleMessage.args() method + +**Signature:** + +```typescript +class ConsoleMessage { + args(): JSHandle[]; +} +``` + +**Returns:** + +[JSHandle](./puppeteer.jshandle.md)\[\] + +An array of arguments passed to the console. diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.consolemessage.location.md b/website/versioned_docs/version-16.0.0/api/puppeteer.consolemessage.location.md new file mode 100644 index 00000000000..009e12bb58a --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.consolemessage.location.md @@ -0,0 +1,19 @@ +--- +sidebar_label: ConsoleMessage.location +--- + +# ConsoleMessage.location() method + +**Signature:** + +```typescript +class ConsoleMessage { + location(): ConsoleMessageLocation; +} +``` + +**Returns:** + +[ConsoleMessageLocation](./puppeteer.consolemessagelocation.md) + +The location of the console message. diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.consolemessage.md b/website/versioned_docs/version-16.0.0/api/puppeteer.consolemessage.md new file mode 100644 index 00000000000..b5b0818ddeb --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.consolemessage.md @@ -0,0 +1,29 @@ +--- +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 ConsoleMessage class | + +## Methods + +| Method | Modifiers | Description | +| -------------------------------------------------------- | --------- | ----------- | +| [args()](./puppeteer.consolemessage.args.md) | | | +| [location()](./puppeteer.consolemessage.location.md) | | | +| [stackTrace()](./puppeteer.consolemessage.stacktrace.md) | | | +| [text()](./puppeteer.consolemessage.text.md) | | | +| [type()](./puppeteer.consolemessage.type.md) | | | diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.consolemessage.stacktrace.md b/website/versioned_docs/version-16.0.0/api/puppeteer.consolemessage.stacktrace.md new file mode 100644 index 00000000000..0dbd6997130 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.consolemessage.stacktrace.md @@ -0,0 +1,19 @@ +--- +sidebar_label: ConsoleMessage.stackTrace +--- + +# ConsoleMessage.stackTrace() method + +**Signature:** + +```typescript +class ConsoleMessage { + stackTrace(): ConsoleMessageLocation[]; +} +``` + +**Returns:** + +[ConsoleMessageLocation](./puppeteer.consolemessagelocation.md)\[\] + +The array of locations on the stack of the console message. diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.consolemessage.text.md b/website/versioned_docs/version-16.0.0/api/puppeteer.consolemessage.text.md new file mode 100644 index 00000000000..b757bee5e79 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.consolemessage.text.md @@ -0,0 +1,19 @@ +--- +sidebar_label: ConsoleMessage.text +--- + +# ConsoleMessage.text() method + +**Signature:** + +```typescript +class ConsoleMessage { + text(): string; +} +``` + +**Returns:** + +string + +The text of the console message. diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.consolemessage.type.md b/website/versioned_docs/version-16.0.0/api/puppeteer.consolemessage.type.md new file mode 100644 index 00000000000..4e473ce7c8d --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.consolemessage.type.md @@ -0,0 +1,19 @@ +--- +sidebar_label: ConsoleMessage.type +--- + +# ConsoleMessage.type() method + +**Signature:** + +```typescript +class ConsoleMessage { + type(): ConsoleMessageType; +} +``` + +**Returns:** + +[ConsoleMessageType](./puppeteer.consolemessagetype.md) + +The type of the console message. diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.consolemessagelocation.columnnumber.md b/website/versioned_docs/version-16.0.0/api/puppeteer.consolemessagelocation.columnnumber.md new file mode 100644 index 00000000000..147b26db5ee --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.consolemessagelocation.columnnumber.md @@ -0,0 +1,15 @@ +--- +sidebar_label: ConsoleMessageLocation.columnNumber +--- + +# ConsoleMessageLocation.columnNumber property + +0-based column number in the resource if known or `undefined` otherwise. + +**Signature:** + +```typescript +interface ConsoleMessageLocation { + columnNumber?: number; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.consolemessagelocation.linenumber.md b/website/versioned_docs/version-16.0.0/api/puppeteer.consolemessagelocation.linenumber.md new file mode 100644 index 00000000000..a1a1a3d41be --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.consolemessagelocation.linenumber.md @@ -0,0 +1,15 @@ +--- +sidebar_label: ConsoleMessageLocation.lineNumber +--- + +# ConsoleMessageLocation.lineNumber property + +0-based line number in the resource if known or `undefined` otherwise. + +**Signature:** + +```typescript +interface ConsoleMessageLocation { + lineNumber?: number; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.consolemessagelocation.md b/website/versioned_docs/version-16.0.0/api/puppeteer.consolemessagelocation.md new file mode 100644 index 00000000000..15aa75d8b51 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.consolemessagelocation.md @@ -0,0 +1,19 @@ +--- +sidebar_label: ConsoleMessageLocation +--- + +# ConsoleMessageLocation interface + +**Signature:** + +```typescript +export interface ConsoleMessageLocation +``` + +## Properties + +| Property | Modifiers | Type | Description | +| ------------------------------------------------------------------- | --------- | ------ | ----------------------------------------------------------------------------------------------------- | +| [columnNumber?](./puppeteer.consolemessagelocation.columnnumber.md) | | number | (Optional) 0-based column number in the resource if known or undefined otherwise. | +| [lineNumber?](./puppeteer.consolemessagelocation.linenumber.md) | | number | (Optional) 0-based line number in the resource if known or undefined otherwise. | +| [url?](./puppeteer.consolemessagelocation.url.md) | | string | (Optional) URL of the resource if known or undefined otherwise. | diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.consolemessagelocation.url.md b/website/versioned_docs/version-16.0.0/api/puppeteer.consolemessagelocation.url.md new file mode 100644 index 00000000000..0e460007864 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.consolemessagelocation.url.md @@ -0,0 +1,15 @@ +--- +sidebar_label: ConsoleMessageLocation.url +--- + +# ConsoleMessageLocation.url property + +URL of the resource if known or `undefined` otherwise. + +**Signature:** + +```typescript +interface ConsoleMessageLocation { + url?: string; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.consolemessagetype.md b/website/versioned_docs/version-16.0.0/api/puppeteer.consolemessagetype.md new file mode 100644 index 00000000000..295ea8fd474 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.consolemessagetype.md @@ -0,0 +1,32 @@ +--- +sidebar_label: ConsoleMessageType +--- + +# ConsoleMessageType type + +The supported types for console messages. + +**Signature:** + +```typescript +export declare type ConsoleMessageType = + | 'log' + | 'debug' + | 'info' + | 'error' + | 'warning' + | 'dir' + | 'dirxml' + | 'table' + | 'trace' + | 'clear' + | 'startGroup' + | 'startGroupCollapsed' + | 'endGroup' + | 'assert' + | 'profile' + | 'profileEnd' + | 'count' + | 'timeEnd' + | 'verbose'; +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.continuerequestoverrides.headers.md b/website/versioned_docs/version-16.0.0/api/puppeteer.continuerequestoverrides.headers.md new file mode 100644 index 00000000000..fd0816cd8c7 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.continuerequestoverrides.headers.md @@ -0,0 +1,13 @@ +--- +sidebar_label: ContinueRequestOverrides.headers +--- + +# ContinueRequestOverrides.headers property + +**Signature:** + +```typescript +interface ContinueRequestOverrides { + headers?: Record; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.continuerequestoverrides.md b/website/versioned_docs/version-16.0.0/api/puppeteer.continuerequestoverrides.md new file mode 100644 index 00000000000..ce2ed1b0170 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.continuerequestoverrides.md @@ -0,0 +1,20 @@ +--- +sidebar_label: ContinueRequestOverrides +--- + +# ContinueRequestOverrides interface + +**Signature:** + +```typescript +export interface ContinueRequestOverrides +``` + +## Properties + +| Property | Modifiers | Type | Description | +| ------------------------------------------------------------- | --------- | ---------------------------- | ------------------------------------------------------------------------------ | +| [headers?](./puppeteer.continuerequestoverrides.headers.md) | | Record<string, string> | (Optional) | +| [method?](./puppeteer.continuerequestoverrides.method.md) | | string | (Optional) | +| [postData?](./puppeteer.continuerequestoverrides.postdata.md) | | string | (Optional) | +| [url?](./puppeteer.continuerequestoverrides.url.md) | | string | (Optional) If set, the request URL will change. This is not a redirect. | diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.continuerequestoverrides.method.md b/website/versioned_docs/version-16.0.0/api/puppeteer.continuerequestoverrides.method.md new file mode 100644 index 00000000000..10b6fa43085 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.continuerequestoverrides.method.md @@ -0,0 +1,13 @@ +--- +sidebar_label: ContinueRequestOverrides.method +--- + +# ContinueRequestOverrides.method property + +**Signature:** + +```typescript +interface ContinueRequestOverrides { + method?: string; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.continuerequestoverrides.postdata.md b/website/versioned_docs/version-16.0.0/api/puppeteer.continuerequestoverrides.postdata.md new file mode 100644 index 00000000000..bb27166a2a3 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.continuerequestoverrides.postdata.md @@ -0,0 +1,13 @@ +--- +sidebar_label: ContinueRequestOverrides.postData +--- + +# ContinueRequestOverrides.postData property + +**Signature:** + +```typescript +interface ContinueRequestOverrides { + postData?: string; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.continuerequestoverrides.url.md b/website/versioned_docs/version-16.0.0/api/puppeteer.continuerequestoverrides.url.md new file mode 100644 index 00000000000..b5d92a3da34 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.continuerequestoverrides.url.md @@ -0,0 +1,15 @@ +--- +sidebar_label: ContinueRequestOverrides.url +--- + +# ContinueRequestOverrides.url property + +If set, the request URL will change. This is not a redirect. + +**Signature:** + +```typescript +interface ContinueRequestOverrides { + url?: string; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.coverage._constructor_.md b/website/versioned_docs/version-16.0.0/api/puppeteer.coverage._constructor_.md new file mode 100644 index 00000000000..bd805209530 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.coverage._constructor_.md @@ -0,0 +1,21 @@ +--- +sidebar_label: Coverage.(constructor) +--- + +# Coverage.(constructor) + +Constructs a new instance of the `Coverage` class + +**Signature:** + +```typescript +class Coverage { + constructor(client: CDPSession); +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | --------------------------------------- | ----------- | +| client | [CDPSession](./puppeteer.cdpsession.md) | | diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.coverage.md b/website/versioned_docs/version-16.0.0/api/puppeteer.coverage.md new file mode 100644 index 00000000000..433355abca5 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.coverage.md @@ -0,0 +1,59 @@ +--- +sidebar_label: Coverage +--- + +# Coverage class + +The Coverage class provides methods to gathers 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 Coverage class | + +## Methods + +| Method | Modifiers | Description | +| --------------------------------------------------------------------- | --------- | ----------- | +| [startCSSCoverage(options)](./puppeteer.coverage.startcsscoverage.md) | | | +| [startJSCoverage(options)](./puppeteer.coverage.startjscoverage.md) | | | +| [stopCSSCoverage()](./puppeteer.coverage.stopcsscoverage.md) | | | +| [stopJSCoverage()](./puppeteer.coverage.stopjscoverage.md) | | | diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.coverage.startcsscoverage.md b/website/versioned_docs/version-16.0.0/api/puppeteer.coverage.startcsscoverage.md new file mode 100644 index 00000000000..59597829074 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.coverage.startcsscoverage.md @@ -0,0 +1,25 @@ +--- +sidebar_label: Coverage.startCSSCoverage +--- + +# Coverage.startCSSCoverage() method + +**Signature:** + +```typescript +class Coverage { + startCSSCoverage(options?: CSSCoverageOptions): Promise; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | +| options | [CSSCoverageOptions](./puppeteer.csscoverageoptions.md) | (Optional) Set of configurable options for coverage, defaults to resetOnNavigation : true | + +**Returns:** + +Promise<void> + +Promise that resolves when coverage is started. diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.coverage.startjscoverage.md b/website/versioned_docs/version-16.0.0/api/puppeteer.coverage.startjscoverage.md new file mode 100644 index 00000000000..041897d021d --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.coverage.startjscoverage.md @@ -0,0 +1,29 @@ +--- +sidebar_label: Coverage.startJSCoverage +--- + +# Coverage.startJSCoverage() method + +**Signature:** + +```typescript +class Coverage { + startJSCoverage(options?: JSCoverageOptions): Promise; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ----------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | +| options | [JSCoverageOptions](./puppeteer.jscoverageoptions.md) | (Optional) Set of configurable options for coverage defaults to resetOnNavigation : true, reportAnonymousScripts : false | + +**Returns:** + +Promise<void> + +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 will have `pptr://__puppeteer_evaluation_script__` as their URL. diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.coverage.stopcsscoverage.md b/website/versioned_docs/version-16.0.0/api/puppeteer.coverage.stopcsscoverage.md new file mode 100644 index 00000000000..51b1bdc4a2b --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.coverage.stopcsscoverage.md @@ -0,0 +1,23 @@ +--- +sidebar_label: Coverage.stopCSSCoverage +--- + +# Coverage.stopCSSCoverage() method + +**Signature:** + +```typescript +class Coverage { + stopCSSCoverage(): Promise; +} +``` + +**Returns:** + +Promise<[CoverageEntry](./puppeteer.coverageentry.md)\[\]> + +Promise that resolves to the array of coverage reports for all stylesheets. + +## Remarks + +CSS Coverage doesn't include dynamically injected style tags without sourceURLs. diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.coverage.stopjscoverage.md b/website/versioned_docs/version-16.0.0/api/puppeteer.coverage.stopjscoverage.md new file mode 100644 index 00000000000..2ceeb5e112d --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.coverage.stopjscoverage.md @@ -0,0 +1,23 @@ +--- +sidebar_label: Coverage.stopJSCoverage +--- + +# Coverage.stopJSCoverage() method + +**Signature:** + +```typescript +class Coverage { + stopJSCoverage(): Promise; +} +``` + +**Returns:** + +Promise<[JSCoverageEntry](./puppeteer.jscoverageentry.md)\[\]> + +Promise that resolves to the array of coverage reports for all scripts. + +## Remarks + +JavaScript Coverage doesn't include anonymous scripts by default. However, scripts with sourceURLs are reported. diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.coverageentry.md b/website/versioned_docs/version-16.0.0/api/puppeteer.coverageentry.md new file mode 100644 index 00000000000..1833f9320d2 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.coverageentry.md @@ -0,0 +1,21 @@ +--- +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 | +| --------------------------------------------- | --------- | -------------------------------------------- | --------------------------------------------- | +| [ranges](./puppeteer.coverageentry.ranges.md) | | Array<{ start: number; end: number; }> | The covered range as start and end positions. | +| [text](./puppeteer.coverageentry.text.md) | | string | The content of the style sheet or script. | +| [url](./puppeteer.coverageentry.url.md) | | string | The URL of the style sheet or script. | diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.coverageentry.ranges.md b/website/versioned_docs/version-16.0.0/api/puppeteer.coverageentry.ranges.md new file mode 100644 index 00000000000..18dbd743d24 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.coverageentry.ranges.md @@ -0,0 +1,18 @@ +--- +sidebar_label: CoverageEntry.ranges +--- + +# CoverageEntry.ranges property + +The covered range as start and end positions. + +**Signature:** + +```typescript +interface CoverageEntry { + ranges: Array<{ + start: number; + end: number; + }>; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.coverageentry.text.md b/website/versioned_docs/version-16.0.0/api/puppeteer.coverageentry.text.md new file mode 100644 index 00000000000..0fde8e6544d --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.coverageentry.text.md @@ -0,0 +1,15 @@ +--- +sidebar_label: CoverageEntry.text +--- + +# CoverageEntry.text property + +The content of the style sheet or script. + +**Signature:** + +```typescript +interface CoverageEntry { + text: string; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.coverageentry.url.md b/website/versioned_docs/version-16.0.0/api/puppeteer.coverageentry.url.md new file mode 100644 index 00000000000..4a2d4ed209e --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.coverageentry.url.md @@ -0,0 +1,15 @@ +--- +sidebar_label: CoverageEntry.url +--- + +# CoverageEntry.url property + +The URL of the style sheet or script. + +**Signature:** + +```typescript +interface CoverageEntry { + url: string; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.createbrowserfetcher.md b/website/versioned_docs/version-16.0.0/api/puppeteer.createbrowserfetcher.md new file mode 100644 index 00000000000..315779a74e4 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.createbrowserfetcher.md @@ -0,0 +1,12 @@ +--- +sidebar_label: createBrowserFetcher +--- + +# createBrowserFetcher variable + +**Signature:** + +```typescript +createBrowserFetcher: (options: import('./types.js').BrowserFetcherOptions) => + import('./types.js').BrowserFetcher; +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.credentials.md b/website/versioned_docs/version-16.0.0/api/puppeteer.credentials.md new file mode 100644 index 00000000000..6c579e44e75 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.credentials.md @@ -0,0 +1,18 @@ +--- +sidebar_label: Credentials +--- + +# Credentials interface + +**Signature:** + +```typescript +export interface Credentials +``` + +## Properties + +| Property | Modifiers | Type | Description | +| ----------------------------------------------- | --------- | ------ | ----------- | +| [password](./puppeteer.credentials.password.md) | | string | | +| [username](./puppeteer.credentials.username.md) | | string | | diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.credentials.password.md b/website/versioned_docs/version-16.0.0/api/puppeteer.credentials.password.md new file mode 100644 index 00000000000..6407abd94b5 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.credentials.password.md @@ -0,0 +1,13 @@ +--- +sidebar_label: Credentials.password +--- + +# Credentials.password property + +**Signature:** + +```typescript +interface Credentials { + password: string; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.credentials.username.md b/website/versioned_docs/version-16.0.0/api/puppeteer.credentials.username.md new file mode 100644 index 00000000000..bbe2fa694d0 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.credentials.username.md @@ -0,0 +1,13 @@ +--- +sidebar_label: Credentials.username +--- + +# Credentials.username property + +**Signature:** + +```typescript +interface Credentials { + username: string; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.csscoverage._constructor_.md b/website/versioned_docs/version-16.0.0/api/puppeteer.csscoverage._constructor_.md new file mode 100644 index 00000000000..ef61f54ba2d --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.csscoverage._constructor_.md @@ -0,0 +1,21 @@ +--- +sidebar_label: CSSCoverage.(constructor) +--- + +# CSSCoverage.(constructor) + +Constructs a new instance of the `CSSCoverage` class + +**Signature:** + +```typescript +class CSSCoverage { + constructor(client: CDPSession); +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | --------------------------------------- | ----------- | +| client | [CDPSession](./puppeteer.cdpsession.md) | | diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.csscoverage.md b/website/versioned_docs/version-16.0.0/api/puppeteer.csscoverage.md new file mode 100644 index 00000000000..e9c632dba4f --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.csscoverage.md @@ -0,0 +1,24 @@ +--- +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 CSSCoverage class | + +## Methods + +| Method | Modifiers | Description | +| -------------------------------------------------- | --------- | ----------- | +| [start(options)](./puppeteer.csscoverage.start.md) | | | +| [stop()](./puppeteer.csscoverage.stop.md) | | | diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.csscoverage.start.md b/website/versioned_docs/version-16.0.0/api/puppeteer.csscoverage.start.md new file mode 100644 index 00000000000..2bd4dfd8e96 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.csscoverage.start.md @@ -0,0 +1,23 @@ +--- +sidebar_label: CSSCoverage.start +--- + +# CSSCoverage.start() method + +**Signature:** + +```typescript +class CSSCoverage { + start(options?: {resetOnNavigation?: boolean}): Promise; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | -------------------------------- | ----------------- | +| options | { resetOnNavigation?: boolean; } | (Optional) | + +**Returns:** + +Promise<void> diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.csscoverage.stop.md b/website/versioned_docs/version-16.0.0/api/puppeteer.csscoverage.stop.md new file mode 100644 index 00000000000..5f9261d9764 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.csscoverage.stop.md @@ -0,0 +1,17 @@ +--- +sidebar_label: CSSCoverage.stop +--- + +# CSSCoverage.stop() method + +**Signature:** + +```typescript +class CSSCoverage { + stop(): Promise; +} +``` + +**Returns:** + +Promise<[CoverageEntry](./puppeteer.coverageentry.md)\[\]> diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.csscoverageoptions.md b/website/versioned_docs/version-16.0.0/api/puppeteer.csscoverageoptions.md new file mode 100644 index 00000000000..64f7b660669 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.csscoverageoptions.md @@ -0,0 +1,19 @@ +--- +sidebar_label: CSSCoverageOptions +--- + +# CSSCoverageOptions interface + +Set of configurable options for CSS coverage. + +**Signature:** + +```typescript +export interface CSSCoverageOptions +``` + +## Properties + +| Property | Modifiers | Type | Description | +| ------------------------------------------------------------------------- | --------- | ------- | ---------------------------------------------------------------- | +| [resetOnNavigation?](./puppeteer.csscoverageoptions.resetonnavigation.md) | | boolean | (Optional) Whether to reset coverage on every navigation. | diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.csscoverageoptions.resetonnavigation.md b/website/versioned_docs/version-16.0.0/api/puppeteer.csscoverageoptions.resetonnavigation.md new file mode 100644 index 00000000000..a559bde6767 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.csscoverageoptions.resetonnavigation.md @@ -0,0 +1,15 @@ +--- +sidebar_label: CSSCoverageOptions.resetOnNavigation +--- + +# CSSCoverageOptions.resetOnNavigation property + +Whether to reset coverage on every navigation. + +**Signature:** + +```typescript +interface CSSCoverageOptions { + resetOnNavigation?: boolean; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.customerror._constructor_.md b/website/versioned_docs/version-16.0.0/api/puppeteer.customerror._constructor_.md new file mode 100644 index 00000000000..6283b96d0b0 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.customerror._constructor_.md @@ -0,0 +1,21 @@ +--- +sidebar_label: CustomError.(constructor) +--- + +# CustomError.(constructor) + +Constructs a new instance of the `CustomError` class + +**Signature:** + +```typescript +class CustomError { + constructor(message?: string); +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ------ | ----------------- | +| message | string | (Optional) | diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.customerror.md b/website/versioned_docs/version-16.0.0/api/puppeteer.customerror.md new file mode 100644 index 00000000000..fd30b1edf85 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.customerror.md @@ -0,0 +1,19 @@ +--- +sidebar_label: CustomError +--- + +# CustomError class + +**Signature:** + +```typescript +export declare class CustomError extends Error +``` + +**Extends:** Error + +## Constructors + +| Constructor | Modifiers | Description | +| ------------------------------------------------------------------ | --------- | --------------------------------------------------------------- | +| [(constructor)(message)](./puppeteer.customerror._constructor_.md) | | Constructs a new instance of the CustomError class | diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.customqueryhandler.md b/website/versioned_docs/version-16.0.0/api/puppeteer.customqueryhandler.md new file mode 100644 index 00000000000..e2420101f77 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.customqueryhandler.md @@ -0,0 +1,20 @@ +--- +sidebar_label: CustomQueryHandler +--- + +# CustomQueryHandler interface + +Contains two functions `queryOne` and `queryAll` that can be [registered](./puppeteer.registercustomqueryhandler.md) as alternative querying strategies. The functions `queryOne` and `queryAll` are executed in the page context. `queryOne` should take an `Element` and a selector string as argument and return a single `Element` or `null` if no element is found. `queryAll` takes the same arguments but should instead return a `NodeListOf` or `Array` with all the elements that match the given query selector. + +**Signature:** + +```typescript +export interface CustomQueryHandler +``` + +## Properties + +| Property | Modifiers | Type | Description | +| ------------------------------------------------------- | --------- | ---------------------------------------------------- | ----------------- | +| [queryAll?](./puppeteer.customqueryhandler.queryall.md) | | (element: Node, selector: string) => Node\[\] | (Optional) | +| [queryOne?](./puppeteer.customqueryhandler.queryone.md) | | (element: Node, selector: string) => Node \| null | (Optional) | diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.customqueryhandler.queryall.md b/website/versioned_docs/version-16.0.0/api/puppeteer.customqueryhandler.queryall.md new file mode 100644 index 00000000000..f6f88e56359 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.customqueryhandler.queryall.md @@ -0,0 +1,13 @@ +--- +sidebar_label: CustomQueryHandler.queryAll +--- + +# CustomQueryHandler.queryAll property + +**Signature:** + +```typescript +interface CustomQueryHandler { + queryAll?: (element: Node, selector: string) => Node[]; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.customqueryhandler.queryone.md b/website/versioned_docs/version-16.0.0/api/puppeteer.customqueryhandler.queryone.md new file mode 100644 index 00000000000..b1cdbf4411f --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.customqueryhandler.queryone.md @@ -0,0 +1,13 @@ +--- +sidebar_label: CustomQueryHandler.queryOne +--- + +# CustomQueryHandler.queryOne property + +**Signature:** + +```typescript +interface CustomQueryHandler { + queryOne?: (element: Node, selector: string) => Node | null; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.customqueryhandlernames.md b/website/versioned_docs/version-16.0.0/api/puppeteer.customqueryhandlernames.md new file mode 100644 index 00000000000..9774e6a2b7b --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.customqueryhandlernames.md @@ -0,0 +1,17 @@ +--- +sidebar_label: customQueryHandlerNames +--- + +# customQueryHandlerNames() function + +**Signature:** + +```typescript +export declare function customQueryHandlerNames(): string[]; +``` + +**Returns:** + +string\[\] + +a list with the names of all registered custom query handlers. diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.default_intercept_resolution_priority.md b/website/versioned_docs/version-16.0.0/api/puppeteer.default_intercept_resolution_priority.md new file mode 100644 index 00000000000..e183caa36db --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.default_intercept_resolution_priority.md @@ -0,0 +1,13 @@ +--- +sidebar_label: DEFAULT_INTERCEPT_RESOLUTION_PRIORITY +--- + +# DEFAULT_INTERCEPT_RESOLUTION_PRIORITY variable + +The default cooperative request interception resolution priority + +**Signature:** + +```typescript +DEFAULT_INTERCEPT_RESOLUTION_PRIORITY = 0; +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.defaultargs.md b/website/versioned_docs/version-16.0.0/api/puppeteer.defaultargs.md new file mode 100644 index 00000000000..053e0fb5080 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.defaultargs.md @@ -0,0 +1,11 @@ +--- +sidebar_label: defaultArgs +--- + +# defaultArgs variable + +**Signature:** + +```typescript +defaultArgs: (options?: import("./types.js").BrowserLaunchArgumentOptions) => string[] +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.device.md b/website/versioned_docs/version-16.0.0/api/puppeteer.device.md new file mode 100644 index 00000000000..f284e7b0924 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.device.md @@ -0,0 +1,19 @@ +--- +sidebar_label: Device +--- + +# Device interface + +**Signature:** + +```typescript +export interface Device +``` + +## Properties + +| Property | Modifiers | Type | Description | +| -------------------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------- | ----------- | +| [name](./puppeteer.device.name.md) | | string | | +| [userAgent](./puppeteer.device.useragent.md) | | string | | +| [viewport](./puppeteer.device.viewport.md) | | { width: number; height: number; deviceScaleFactor: number; isMobile: boolean; hasTouch: boolean; isLandscape: boolean; } | | diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.device.name.md b/website/versioned_docs/version-16.0.0/api/puppeteer.device.name.md new file mode 100644 index 00000000000..467a6bd1a1f --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.device.name.md @@ -0,0 +1,13 @@ +--- +sidebar_label: Device.name +--- + +# Device.name property + +**Signature:** + +```typescript +interface Device { + name: string; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.device.useragent.md b/website/versioned_docs/version-16.0.0/api/puppeteer.device.useragent.md new file mode 100644 index 00000000000..b65382ca2ae --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.device.useragent.md @@ -0,0 +1,13 @@ +--- +sidebar_label: Device.userAgent +--- + +# Device.userAgent property + +**Signature:** + +```typescript +interface Device { + userAgent: string; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.device.viewport.md b/website/versioned_docs/version-16.0.0/api/puppeteer.device.viewport.md new file mode 100644 index 00000000000..5b3e8bd0488 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.device.viewport.md @@ -0,0 +1,20 @@ +--- +sidebar_label: Device.viewport +--- + +# Device.viewport property + +**Signature:** + +```typescript +interface Device { + viewport: { + width: number; + height: number; + deviceScaleFactor: number; + isMobile: boolean; + hasTouch: boolean; + isLandscape: boolean; + }; +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.devices.md b/website/versioned_docs/version-16.0.0/api/puppeteer.devices.md new file mode 100644 index 00000000000..8b688a4f1b1 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.devices.md @@ -0,0 +1,29 @@ +--- +sidebar_label: devices +--- + +# devices variable + +A list of devices to be used with `page.emulate(options)`. Actual list of devices can be found in [src/common/DeviceDescriptors.ts](https://github.com/puppeteer/puppeteer/blob/main/src/common/DeviceDescriptors.ts). + +**Signature:** + +```typescript +devices: DevicesMap; +``` + +## Example + +```ts +const puppeteer = require('puppeteer'); +const iPhone = puppeteer.devices['iPhone 6']; + +(async () => { + const browser = await puppeteer.launch(); + const page = await browser.newPage(); + await page.emulate(iPhone); + await page.goto('https://www.google.com'); + // other actions... + await browser.close(); +})(); +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.devicesmap.md b/website/versioned_docs/version-16.0.0/api/puppeteer.devicesmap.md new file mode 100644 index 00000000000..ec2b4a3da02 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.devicesmap.md @@ -0,0 +1,15 @@ +--- +sidebar_label: DevicesMap +--- + +# DevicesMap type + +**Signature:** + +```typescript +export declare type DevicesMap = { + [name: string]: Device; +}; +``` + +**References:** [Device](./puppeteer.device.md) diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.dialog.accept.md b/website/versioned_docs/version-16.0.0/api/puppeteer.dialog.accept.md new file mode 100644 index 00000000000..39d84e504e4 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.dialog.accept.md @@ -0,0 +1,25 @@ +--- +sidebar_label: Dialog.accept +--- + +# Dialog.accept() method + +**Signature:** + +```typescript +class Dialog { + accept(promptText?: string): Promise; +} +``` + +## 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 prompt. | + +**Returns:** + +Promise<void> + +A promise that resolves when the dialog has been accepted. diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.dialog.defaultvalue.md b/website/versioned_docs/version-16.0.0/api/puppeteer.dialog.defaultvalue.md new file mode 100644 index 00000000000..4880551dbc3 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.dialog.defaultvalue.md @@ -0,0 +1,19 @@ +--- +sidebar_label: Dialog.defaultValue +--- + +# Dialog.defaultValue() method + +**Signature:** + +```typescript +class Dialog { + defaultValue(): string; +} +``` + +**Returns:** + +string + +The default value of the prompt, or an empty string if the dialog is not a `prompt`. diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.dialog.dismiss.md b/website/versioned_docs/version-16.0.0/api/puppeteer.dialog.dismiss.md new file mode 100644 index 00000000000..097fda7ed2a --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.dialog.dismiss.md @@ -0,0 +1,19 @@ +--- +sidebar_label: Dialog.dismiss +--- + +# Dialog.dismiss() method + +**Signature:** + +```typescript +class Dialog { + dismiss(): Promise; +} +``` + +**Returns:** + +Promise<void> + +A promise which will resolve once the dialog has been dismissed diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.dialog.md b/website/versioned_docs/version-16.0.0/api/puppeteer.dialog.md new file mode 100644 index 00000000000..14a34f57863 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.dialog.md @@ -0,0 +1,44 @@ +--- +sidebar_label: Dialog +--- + +# Dialog class + +Dialog instances are dispatched by the [Page](./puppeteer.page.md) via the `dialog` event. + +**Signature:** + +```typescript +export declare 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 +const puppeteer = require('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) | | | +| [defaultValue()](./puppeteer.dialog.defaultvalue.md) | | | +| [dismiss()](./puppeteer.dialog.dismiss.md) | | | +| [message()](./puppeteer.dialog.message.md) | | | +| [type()](./puppeteer.dialog.type.md) | | | diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.dialog.message.md b/website/versioned_docs/version-16.0.0/api/puppeteer.dialog.message.md new file mode 100644 index 00000000000..5e3b60a617b --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.dialog.message.md @@ -0,0 +1,19 @@ +--- +sidebar_label: Dialog.message +--- + +# Dialog.message() method + +**Signature:** + +```typescript +class Dialog { + message(): string; +} +``` + +**Returns:** + +string + +The message displayed in the dialog. diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.dialog.type.md b/website/versioned_docs/version-16.0.0/api/puppeteer.dialog.type.md new file mode 100644 index 00000000000..dabdb19a006 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.dialog.type.md @@ -0,0 +1,19 @@ +--- +sidebar_label: Dialog.type +--- + +# Dialog.type() method + +**Signature:** + +```typescript +class Dialog { + type(): Protocol.Page.DialogType; +} +``` + +**Returns:** + +Protocol.Page.DialogType + +The type of the dialog. diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle._.md b/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle._.md new file mode 100644 index 00000000000..2d2f3b3ad66 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle._.md @@ -0,0 +1,33 @@ +--- +sidebar_label: ElementHandle.$ +--- + +# ElementHandle.$() method + +Runs `element.querySelector` within the page. + +**Signature:** + +```typescript +class ElementHandle { + $( + selector: Selector + ): Promise> | null>; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | -------- | --------------------------- | +| selector | Selector | The selector to query with. | + +**Returns:** + +Promise<[ElementHandle](./puppeteer.elementhandle.md)<[NodeFor](./puppeteer.nodefor.md)<Selector>> \| null> + +`null` if no element matches the selector. + +## Exceptions + +`Error` if the selector has no associated query handler. diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.__.md b/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.__.md new file mode 100644 index 00000000000..5d18f3cbb3f --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.__.md @@ -0,0 +1,33 @@ +--- +sidebar_label: ElementHandle.$$ +--- + +# ElementHandle.$$() method + +Runs `element.querySelectorAll` within the page. + +**Signature:** + +```typescript +class ElementHandle { + $$( + selector: Selector + ): Promise>>>; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | -------- | --------------------------- | +| selector | Selector | The selector to query with. | + +**Returns:** + +Promise<Array<[ElementHandle](./puppeteer.elementhandle.md)<[NodeFor](./puppeteer.nodefor.md)<Selector>>>> + +`[]` if no element matches the selector. + +## Exceptions + +`Error` if the selector has no associated query handler. diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.__eval.md b/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.__eval.md new file mode 100644 index 00000000000..837be87b467 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.__eval.md @@ -0,0 +1,57 @@ +--- +sidebar_label: ElementHandle.$$eval +--- + +# ElementHandle.$$eval() method + +This method runs `document.querySelectorAll` within the element and passes it as the first argument to `pageFunction`. If there's no element matching `selector`, the method throws an error. + +If `pageFunction` returns a Promise, then `frame.$$eval` would wait for the promise to resolve and return its value. + +**Signature:** + +```typescript +class ElementHandle { + $$eval< + Selector extends string, + Params extends unknown[], + Func extends EvaluateFunc< + [Array>, ...Params] + > = EvaluateFunc<[Array>, ...Params]> + >( + selector: Selector, + pageFunction: Func | string, + ...args: Params + ): Promise>>; +} +``` + +## Parameters + +| Parameter | Type | Description | +| ------------ | -------------- | ----------- | +| selector | Selector | | +| pageFunction | Func \| string | | +| args | Params | | + +**Returns:** + +Promise<Awaited<ReturnType<Func>>> + +## Example 1 + +```html +
+
Hello!
+
Hi!
+
+``` + +## Example 2 + +```ts +const feedHandle = await page.$('.feed'); +expect( + await feedHandle.$$eval('.tweet', nodes => nodes.map(n => n.innerText)) +).toEqual(['Hello!', 'Hi!']); +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle._eval.md b/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle._eval.md new file mode 100644 index 00000000000..f67319183bb --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle._eval.md @@ -0,0 +1,47 @@ +--- +sidebar_label: ElementHandle.$eval +--- + +# ElementHandle.$eval() method + +This method runs `document.querySelector` within the element and passes it as the first argument to `pageFunction`. If there's no element matching `selector`, the method throws an error. + +If `pageFunction` returns a Promise, then `frame.$eval` would wait for the promise to resolve and return its value. + +**Signature:** + +```typescript +class ElementHandle { + $eval< + Selector extends string, + Params extends unknown[], + Func extends EvaluateFunc< + [ElementHandle>, ...Params] + > = EvaluateFunc<[ElementHandle>, ...Params]> + >( + selector: Selector, + pageFunction: Func | string, + ...args: Params + ): Promise>>; +} +``` + +## Parameters + +| Parameter | Type | Description | +| ------------ | -------------- | ----------- | +| selector | Selector | | +| pageFunction | Func \| string | | +| args | Params | | + +**Returns:** + +Promise<Awaited<ReturnType<Func>>> + +## Example + +```ts +const tweetHandle = await page.$('.tweet'); +expect(await tweetHandle.$eval('.like', node => node.innerText)).toBe('100'); +expect(await tweetHandle.$eval('.retweets', node => node.innerText)).toBe('10'); +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle._x.md b/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle._x.md new file mode 100644 index 00000000000..d1756a75f00 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle._x.md @@ -0,0 +1,25 @@ +--- +sidebar_label: ElementHandle.$x +--- + +# ElementHandle.$x() method + +The method evaluates the XPath expression relative to the elementHandle. If there are no such elements, the method will resolve to an empty array. + +**Signature:** + +```typescript +class ElementHandle { + $x(expression: string): Promise>>; +} +``` + +## Parameters + +| Parameter | Type | Description | +| ---------- | ------ | -------------------------------------------------------------------------------------------- | +| expression | string | Expression to [evaluate](https://developer.mozilla.org/en-US/docs/Web/API/Document/evaluate) | + +**Returns:** + +Promise<Array<[ElementHandle](./puppeteer.elementhandle.md)<Node>>> diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.aselement.md b/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.aselement.md new file mode 100644 index 00000000000..8c55d209c36 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.aselement.md @@ -0,0 +1,17 @@ +--- +sidebar_label: ElementHandle.asElement +--- + +# ElementHandle.asElement() method + +**Signature:** + +```typescript +class ElementHandle { + asElement(): ElementHandle | null; +} +``` + +**Returns:** + +[ElementHandle](./puppeteer.elementhandle.md)<ElementType> \| null diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.boundingbox.md b/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.boundingbox.md new file mode 100644 index 00000000000..529d103f252 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.boundingbox.md @@ -0,0 +1,19 @@ +--- +sidebar_label: ElementHandle.boundingBox +--- + +# ElementHandle.boundingBox() method + +This method returns the bounding box of the element (relative to the main frame), or `null` if the element is not visible. + +**Signature:** + +```typescript +class ElementHandle { + boundingBox(): Promise; +} +``` + +**Returns:** + +Promise<[BoundingBox](./puppeteer.boundingbox.md) \| null> diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.boxmodel.md b/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.boxmodel.md new file mode 100644 index 00000000000..bcb74f711f0 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.boxmodel.md @@ -0,0 +1,23 @@ +--- +sidebar_label: ElementHandle.boxModel +--- + +# ElementHandle.boxModel() method + +This method returns boxes of the element, or `null` if the element is not visible. + +**Signature:** + +```typescript +class ElementHandle { + boxModel(): Promise; +} +``` + +**Returns:** + +Promise<[BoxModel](./puppeteer.boxmodel.md) \| null> + +## Remarks + +Boxes are represented as an array of points; Each Point is an object `{x, y}`. Box points are sorted clock-wise. diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.click.md b/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.click.md new file mode 100644 index 00000000000..820e44285be --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.click.md @@ -0,0 +1,26 @@ +--- +sidebar_label: ElementHandle.click +--- + +# ElementHandle.click() method + +This method scrolls element into view if needed, and then uses [Page.mouse](./puppeteer.page.mouse.md) to click in the center of the element. If the element is detached from DOM, the method throws an error. + +**Signature:** + +```typescript +class ElementHandle { + click(this: ElementHandle, options?: ClickOptions): Promise; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ------------------------------------------------------------ | ----------------- | +| this | [ElementHandle](./puppeteer.elementhandle.md)<Element> | | +| options | [ClickOptions](./puppeteer.clickoptions.md) | (Optional) | + +**Returns:** + +Promise<void> diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.clickablepoint.md b/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.clickablepoint.md new file mode 100644 index 00000000000..a1371f0fc7c --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.clickablepoint.md @@ -0,0 +1,25 @@ +--- +sidebar_label: ElementHandle.clickablePoint +--- + +# ElementHandle.clickablePoint() method + +Returns the middle point within an element unless a specific offset is provided. + +**Signature:** + +```typescript +class ElementHandle { + clickablePoint(offset?: Offset): Promise; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ------------------------------- | ----------------- | +| offset | [Offset](./puppeteer.offset.md) | (Optional) | + +**Returns:** + +Promise<[Point](./puppeteer.point.md)> diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.contentframe.md b/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.contentframe.md new file mode 100644 index 00000000000..6ce9e88a20b --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.contentframe.md @@ -0,0 +1,19 @@ +--- +sidebar_label: ElementHandle.contentFrame +--- + +# ElementHandle.contentFrame() method + +Resolves to the content frame for element handles referencing iframe nodes, or null otherwise + +**Signature:** + +```typescript +class ElementHandle { + contentFrame(): Promise; +} +``` + +**Returns:** + +Promise<[Frame](./puppeteer.frame.md) \| null> diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.drag.md b/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.drag.md new file mode 100644 index 00000000000..b0ddb62cd41 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.drag.md @@ -0,0 +1,29 @@ +--- +sidebar_label: ElementHandle.drag +--- + +# ElementHandle.drag() method + +This method creates and captures a dragevent from the element. + +**Signature:** + +```typescript +class ElementHandle { + drag( + this: ElementHandle, + target: Point + ): Promise; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ------------------------------------------------------------ | ----------- | +| this | [ElementHandle](./puppeteer.elementhandle.md)<Element> | | +| target | [Point](./puppeteer.point.md) | | + +**Returns:** + +Promise<Protocol.Input.DragData> diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.draganddrop.md b/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.draganddrop.md new file mode 100644 index 00000000000..efec7602aed --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.draganddrop.md @@ -0,0 +1,33 @@ +--- +sidebar_label: ElementHandle.dragAndDrop +--- + +# ElementHandle.dragAndDrop() method + +This method triggers a dragenter, dragover, and drop on the element. + +**Signature:** + +```typescript +class ElementHandle { + dragAndDrop( + this: ElementHandle, + target: ElementHandle, + options?: { + delay: number; + } + ): Promise; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ------------------------------------------------------------ | ----------------- | +| this | [ElementHandle](./puppeteer.elementhandle.md)<Element> | | +| target | [ElementHandle](./puppeteer.elementhandle.md)<Node> | | +| options | { delay: number; } | (Optional) | + +**Returns:** + +Promise<void> diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.dragenter.md b/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.dragenter.md new file mode 100644 index 00000000000..2f8f3b82f7e --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.dragenter.md @@ -0,0 +1,29 @@ +--- +sidebar_label: ElementHandle.dragEnter +--- + +# ElementHandle.dragEnter() method + +This method creates a `dragenter` event on the element. + +**Signature:** + +```typescript +class ElementHandle { + dragEnter( + this: ElementHandle, + data?: Protocol.Input.DragData + ): Promise; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ------------------------------------------------------------ | ----------------- | +| this | [ElementHandle](./puppeteer.elementhandle.md)<Element> | | +| data | Protocol.Input.DragData | (Optional) | + +**Returns:** + +Promise<void> diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.dragover.md b/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.dragover.md new file mode 100644 index 00000000000..90db5c5cd50 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.dragover.md @@ -0,0 +1,29 @@ +--- +sidebar_label: ElementHandle.dragOver +--- + +# ElementHandle.dragOver() method + +This method creates a `dragover` event on the element. + +**Signature:** + +```typescript +class ElementHandle { + dragOver( + this: ElementHandle, + data?: Protocol.Input.DragData + ): Promise; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ------------------------------------------------------------ | ----------------- | +| this | [ElementHandle](./puppeteer.elementhandle.md)<Element> | | +| data | Protocol.Input.DragData | (Optional) | + +**Returns:** + +Promise<void> diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.drop.md b/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.drop.md new file mode 100644 index 00000000000..47d3af82cb1 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.drop.md @@ -0,0 +1,29 @@ +--- +sidebar_label: ElementHandle.drop +--- + +# ElementHandle.drop() method + +This method triggers a drop on the element. + +**Signature:** + +```typescript +class ElementHandle { + drop( + this: ElementHandle, + data?: Protocol.Input.DragData + ): Promise; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ------------------------------------------------------------ | ----------------- | +| this | [ElementHandle](./puppeteer.elementhandle.md)<Element> | | +| data | Protocol.Input.DragData | (Optional) | + +**Returns:** + +Promise<void> diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.focus.md b/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.focus.md new file mode 100644 index 00000000000..6681a295c5b --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.focus.md @@ -0,0 +1,19 @@ +--- +sidebar_label: ElementHandle.focus +--- + +# ElementHandle.focus() method + +Calls [focus](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus) on the element. + +**Signature:** + +```typescript +class ElementHandle { + focus(): Promise; +} +``` + +**Returns:** + +Promise<void> diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.hover.md b/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.hover.md new file mode 100644 index 00000000000..874ed7a7c49 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.hover.md @@ -0,0 +1,25 @@ +--- +sidebar_label: ElementHandle.hover +--- + +# ElementHandle.hover() method + +This method scrolls element into view if needed, and then uses [Page.mouse](./puppeteer.page.mouse.md) to hover over the center of the element. If the element is detached from DOM, the method throws an error. + +**Signature:** + +```typescript +class ElementHandle { + hover(this: ElementHandle): Promise; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ------------------------------------------------------------ | ----------- | +| this | [ElementHandle](./puppeteer.elementhandle.md)<Element> | | + +**Returns:** + +Promise<void> diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.isintersectingviewport.md b/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.isintersectingviewport.md new file mode 100644 index 00000000000..4eaafc38fc0 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.isintersectingviewport.md @@ -0,0 +1,31 @@ +--- +sidebar_label: ElementHandle.isIntersectingViewport +--- + +# ElementHandle.isIntersectingViewport() method + +Resolves to true if the element is visible in the current viewport. + +**Signature:** + +```typescript +class ElementHandle { + isIntersectingViewport( + this: ElementHandle, + options?: { + threshold?: number; + } + ): Promise; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ------------------------------------------------------------ | ----------------- | +| this | [ElementHandle](./puppeteer.elementhandle.md)<Element> | | +| options | { threshold?: number; } | (Optional) | + +**Returns:** + +Promise<boolean> diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.md b/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.md new file mode 100644 index 00000000000..e5a303a30eb --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.md @@ -0,0 +1,94 @@ +--- +sidebar_label: ElementHandle +--- + +# ElementHandle class + +ElementHandle represents an in-page DOM element. + +**Signature:** + +```typescript +export declare class ElementHandle extends JSHandle +``` + +**Extends:** [JSHandle](./puppeteer.jshandle.md) + +## Remarks + +ElementHandles can be created with the [Page.$()](./puppeteer.page._.md) method. + +```ts +const puppeteer = require('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 `` element matching `selector`, the method throws an error. + +**Signature:** + +```typescript +class ElementHandle { + select(...values: string[]): Promise; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| values | string\[\] | Values of options to select. If the <select> has the multiple attribute, all values are considered, otherwise only the first one is taken into account. | + +**Returns:** + +Promise<string\[\]> + +## Example + +```ts +handle.select('blue'); // single selection +handle.select('red', 'green', 'blue'); // multiple selections +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.tap.md b/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.tap.md new file mode 100644 index 00000000000..6676560252a --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.tap.md @@ -0,0 +1,25 @@ +--- +sidebar_label: ElementHandle.tap +--- + +# ElementHandle.tap() method + +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. + +**Signature:** + +```typescript +class ElementHandle { + tap(this: ElementHandle): Promise; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ------------------------------------------------------------ | ----------- | +| this | [ElementHandle](./puppeteer.elementhandle.md)<Element> | | + +**Returns:** + +Promise<void> diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.type.md b/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.type.md new file mode 100644 index 00000000000..0b28ff0ce2c --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.type.md @@ -0,0 +1,50 @@ +--- +sidebar_label: ElementHandle.type +--- + +# ElementHandle.type() method + +Focuses the element, and then sends a `keydown`, `keypress`/`input`, and `keyup` event for each character in the text. + +To press a special key, like `Control` or `ArrowDown`, use [ElementHandle.press()](./puppeteer.elementhandle.press.md). + +**Signature:** + +```typescript +class ElementHandle { + type( + text: string, + options?: { + delay: number; + } + ): Promise; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ------------------ | ----------------- | +| text | string | | +| options | { delay: number; } | (Optional) | + +**Returns:** + +Promise<void> + +## Example 1 + +```ts +await elementHandle.type('Hello'); // Types instantly +await elementHandle.type('World', {delay: 100}); // Types slower, like a user +``` + +## Example 2 + +An example of typing into a text field and then submitting the form: + +```ts +const elementHandle = await page.$('input'); +await elementHandle.type('some text'); +await elementHandle.press('Enter'); +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.uploadfile.md b/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.uploadfile.md new file mode 100644 index 00000000000..5380171e214 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.uploadfile.md @@ -0,0 +1,29 @@ +--- +sidebar_label: ElementHandle.uploadFile +--- + +# ElementHandle.uploadFile() method + +This method expects `elementHandle` to point to an [input element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input). + +**Signature:** + +```typescript +class ElementHandle { + uploadFile( + this: ElementHandle, + ...filePaths: string[] + ): Promise; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | --------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| this | [ElementHandle](./puppeteer.elementhandle.md)<HTMLInputElement> | | +| filePaths | string\[\] | Sets the value of the file input to these paths. If a path is relative, then it is resolved against the [current working directory](https://nodejs.org/api/process.html#process_process_cwd). Note for locals script connecting to remote chrome environments, paths must be absolute. | + +**Returns:** + +Promise<void> diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.waitforselector.md b/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.waitforselector.md new file mode 100644 index 00000000000..22617c4b184 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.waitforselector.md @@ -0,0 +1,43 @@ +--- +sidebar_label: ElementHandle.waitForSelector +--- + +# ElementHandle.waitForSelector() method + +Wait for the `selector` to appear within the element. If at the moment of calling the method the `selector` already exists, the method will return immediately. If the `selector` doesn't appear after the `timeout` milliseconds of waiting, the function will throw. + +This method does not work across navigations or if the element is detached from DOM. + +**Signature:** + +```typescript +class ElementHandle { + waitForSelector( + selector: Selector, + options?: Exclude + ): Promise> | null>; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | -------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ | +| selector | Selector | A [selector](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors) of an element to wait for | +| options | Exclude<[WaitForSelectorOptions](./puppeteer.waitforselectoroptions.md), 'root'> | (Optional) Optional waiting parameters | + +**Returns:** + +Promise<[ElementHandle](./puppeteer.elementhandle.md)<[NodeFor](./puppeteer.nodefor.md)<Selector>> \| null> + +Promise which resolves when element specified by selector string is added to DOM. Resolves to `null` if waiting for hidden: `true` and selector is not found in DOM. + +## Remarks + +The optional parameters in `options` are: + +- `visible`: wait for the selected element to be present in DOM and to be visible, i.e. to not have `display: none` or `visibility: hidden` CSS properties. Defaults to `false`. + +- `hidden`: wait for the selected element to not be found in the DOM or to be hidden, i.e. have `display: none` or `visibility: hidden` CSS properties. Defaults to `false`. + +- `timeout`: maximum time to wait in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by using the [Page.setDefaultTimeout()](./puppeteer.page.setdefaulttimeout.md) method. diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.waitforxpath.md b/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.waitforxpath.md new file mode 100644 index 00000000000..631eefcb14b --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.elementhandle.waitforxpath.md @@ -0,0 +1,69 @@ +--- +sidebar_label: ElementHandle.waitForXPath +--- + +# ElementHandle.waitForXPath() method + +Wait for the `xpath` within the element. If at the moment of calling the method the `xpath` already exists, the method will return immediately. If the `xpath` doesn't appear after the `timeout` milliseconds of waiting, the function will throw. + +If `xpath` starts with `//` instead of `.//`, the dot will be appended automatically. + +This method works across navigation + +```ts +const puppeteer = require('puppeteer'); +(async () => { + const browser = await puppeteer.launch(); + const page = await browser.newPage(); + let currentURL; + page + .waitForXPath('//img') + .then(() => console.log('First URL with image: ' + currentURL)); + for (currentURL of [ + 'https://example.com', + 'https://google.com', + 'https://bbc.com', + ]) { + await page.goto(currentURL); + } + await browser.close(); +})(); +``` + +**Signature:** + +```typescript +class ElementHandle { + waitForXPath( + xpath: string, + options?: { + visible?: boolean; + hidden?: boolean; + timeout?: number; + } + ): Promise | null>; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ---------------------------------------------------------- | --------------------------------------------------------------------------------------- | +| xpath | string | A [xpath](https://developer.mozilla.org/en-US/docs/Web/XPath) of an element to wait for | +| options | { visible?: boolean; hidden?: boolean; timeout?: number; } | (Optional) Optional waiting parameters | + +**Returns:** + +Promise<[ElementHandle](./puppeteer.elementhandle.md)<Node> \| null> + +Promise which resolves when element specified by xpath string is added to DOM. Resolves to `null` if waiting for `hidden: true` and xpath is not found in DOM. + +## Remarks + +The optional Argument `options` have properties: + +- `visible`: A boolean to wait for element to be present in DOM and to be visible, i.e. to not have `display: none` or `visibility: hidden` CSS properties. Defaults to `false`. + +- `hidden`: A boolean wait for element to not be found in the DOM or to be hidden, i.e. have `display: none` or `visibility: hidden` CSS properties. Defaults to `false`. + +- `timeout`: A number which is maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by using the [Page.setDefaultTimeout()](./puppeteer.page.setdefaulttimeout.md) method. diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.errorcode.md b/website/versioned_docs/version-16.0.0/api/puppeteer.errorcode.md new file mode 100644 index 00000000000..75f971cfdaa --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.errorcode.md @@ -0,0 +1,25 @@ +--- +sidebar_label: ErrorCode +--- + +# ErrorCode type + +**Signature:** + +```typescript +export declare type ErrorCode = + | 'aborted' + | 'accessdenied' + | 'addressunreachable' + | 'blockedbyclient' + | 'blockedbyresponse' + | 'connectionaborted' + | 'connectionclosed' + | 'connectionfailed' + | 'connectionrefused' + | 'connectionreset' + | 'internetdisconnected' + | 'namenotresolved' + | 'timedout' + | 'failed'; +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.errors.md b/website/versioned_docs/version-16.0.0/api/puppeteer.errors.md new file mode 100644 index 00000000000..81ddf0545d7 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.errors.md @@ -0,0 +1,29 @@ +--- +sidebar_label: errors +--- + +# errors variable + +Puppeteer methods might throw errors if they are unable to fulfill a request. For example, `page.waitForSelector(selector[, options])` might fail if the selector doesn't match any nodes during the given timeframe. + +For certain types of errors Puppeteer uses specific error classes. These classes are available via `puppeteer.errors`. + +**Signature:** + +```typescript +errors: PuppeteerErrors; +``` + +## Example + +An example of handling a timeout error: + +```ts +try { + await page.waitForSelector('.foo'); +} catch (e) { + if (e instanceof puppeteer.errors.TimeoutError) { + // Do something if this is a timeout. + } +} +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.evaluatefunc.md b/website/versioned_docs/version-16.0.0/api/puppeteer.evaluatefunc.md new file mode 100644 index 00000000000..da317d11043 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.evaluatefunc.md @@ -0,0 +1,15 @@ +--- +sidebar_label: EvaluateFunc +--- + +# EvaluateFunc type + +**Signature:** + +```typescript +export declare type EvaluateFunc = ( + ...params: InnerParams +) => Awaitable; +``` + +**References:** [InnerParams](./puppeteer.innerparams.md), [Awaitable](./puppeteer.awaitable.md) diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.evaluation_script_url.md b/website/versioned_docs/version-16.0.0/api/puppeteer.evaluation_script_url.md new file mode 100644 index 00000000000..f75599ef455 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.evaluation_script_url.md @@ -0,0 +1,11 @@ +--- +sidebar_label: EVALUATION_SCRIPT_URL +--- + +# EVALUATION_SCRIPT_URL variable + +**Signature:** + +```typescript +EVALUATION_SCRIPT_URL = 'pptr://__puppeteer_evaluation_script__'; +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.eventemitter.addlistener.md b/website/versioned_docs/version-16.0.0/api/puppeteer.eventemitter.addlistener.md new file mode 100644 index 00000000000..9674b9d71be --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.eventemitter.addlistener.md @@ -0,0 +1,30 @@ +--- +sidebar_label: EventEmitter.addListener +--- + +# EventEmitter.addListener() method + +> Warning: This API is now obsolete. +> +> please use [EventEmitter.on()](./puppeteer.eventemitter.on.md) instead. + +Add an event listener. + +**Signature:** + +```typescript +class EventEmitter { + addListener(event: EventType, handler: Handler): EventEmitter; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ------------------------------------- | ----------- | +| event | [EventType](./puppeteer.eventtype.md) | | +| handler | [Handler](./puppeteer.handler.md) | | + +**Returns:** + +[EventEmitter](./puppeteer.eventemitter.md) diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.eventemitter.emit.md b/website/versioned_docs/version-16.0.0/api/puppeteer.eventemitter.emit.md new file mode 100644 index 00000000000..591e731dd4c --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.eventemitter.emit.md @@ -0,0 +1,28 @@ +--- +sidebar_label: EventEmitter.emit +--- + +# EventEmitter.emit() method + +Emit an event and call any associated listeners. + +**Signature:** + +```typescript +class EventEmitter { + emit(event: EventType, eventData?: unknown): boolean; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ------------------------------------- | ------------------------------------------------------------ | +| event | [EventType](./puppeteer.eventtype.md) | the event you'd like to emit | +| eventData | unknown | (Optional) any data you'd like to emit with the event | + +**Returns:** + +boolean + +`true` if there are any listeners, `false` if there are not. diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.eventemitter.listenercount.md b/website/versioned_docs/version-16.0.0/api/puppeteer.eventemitter.listenercount.md new file mode 100644 index 00000000000..d8ee480d7ca --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.eventemitter.listenercount.md @@ -0,0 +1,27 @@ +--- +sidebar_label: EventEmitter.listenerCount +--- + +# EventEmitter.listenerCount() method + +Gets the number of listeners for a given event. + +**Signature:** + +```typescript +class EventEmitter { + listenerCount(event: EventType): number; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ------------------------------------- | --------------------------------------- | +| event | [EventType](./puppeteer.eventtype.md) | the event to get the listener count for | + +**Returns:** + +number + +the number of listeners bound to the given event diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.eventemitter.md b/website/versioned_docs/version-16.0.0/api/puppeteer.eventemitter.md new file mode 100644 index 00000000000..86ec074835e --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.eventemitter.md @@ -0,0 +1,34 @@ +--- +sidebar_label: EventEmitter +--- + +# EventEmitter class + +The EventEmitter class that many Puppeteer classes extend. + +**Signature:** + +```typescript +export declare class EventEmitter implements CommonEventEmitter +``` + +**Implements:** [CommonEventEmitter](./puppeteer.commoneventemitter.md) + +## 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 | +| ---------------------------------------------------------------------------- | --------- | ------------------------------------------------------------------------------------------------ | +| [addListener(event, handler)](./puppeteer.eventemitter.addlistener.md) | | Add an event listener. | +| [emit(event, eventData)](./puppeteer.eventemitter.emit.md) | | Emit an event and call any associated listeners. | +| [listenerCount(event)](./puppeteer.eventemitter.listenercount.md) | | Gets the number of listeners for a given event. | +| [off(event, handler)](./puppeteer.eventemitter.off.md) | | Remove an event listener from firing. | +| [on(event, handler)](./puppeteer.eventemitter.on.md) | | Bind an event listener to fire when an event occurs. | +| [once(event, handler)](./puppeteer.eventemitter.once.md) | | Like on but the listener will only be fired once and then it will be removed. | +| [removeAllListeners(event)](./puppeteer.eventemitter.removealllisteners.md) | | Removes all listeners. If given an event argument, it will remove only listeners for that event. | +| [removeListener(event, handler)](./puppeteer.eventemitter.removelistener.md) | | Remove an event listener. | diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.eventemitter.off.md b/website/versioned_docs/version-16.0.0/api/puppeteer.eventemitter.off.md new file mode 100644 index 00000000000..c6f20dcd9b0 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.eventemitter.off.md @@ -0,0 +1,28 @@ +--- +sidebar_label: EventEmitter.off +--- + +# EventEmitter.off() method + +Remove an event listener from firing. + +**Signature:** + +```typescript +class EventEmitter { + off(event: EventType, handler: Handler): EventEmitter; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ------------------------------------- | ----------------------------------------------- | +| event | [EventType](./puppeteer.eventtype.md) | the event type you'd like to stop listening to. | +| handler | [Handler](./puppeteer.handler.md) | the function that should be removed. | + +**Returns:** + +[EventEmitter](./puppeteer.eventemitter.md) + +`this` to enable you to chain method calls. diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.eventemitter.on.md b/website/versioned_docs/version-16.0.0/api/puppeteer.eventemitter.on.md new file mode 100644 index 00000000000..e74533b16ff --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.eventemitter.on.md @@ -0,0 +1,28 @@ +--- +sidebar_label: EventEmitter.on +--- + +# EventEmitter.on() method + +Bind an event listener to fire when an event occurs. + +**Signature:** + +```typescript +class EventEmitter { + on(event: EventType, handler: Handler): EventEmitter; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ------------------------------------- | ------------------------------------------------------------------ | +| event | [EventType](./puppeteer.eventtype.md) | the event type you'd like to listen to. Can be a string or symbol. | +| handler | [Handler](./puppeteer.handler.md) | the function to be called when the event occurs. | + +**Returns:** + +[EventEmitter](./puppeteer.eventemitter.md) + +`this` to enable you to chain method calls. diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.eventemitter.once.md b/website/versioned_docs/version-16.0.0/api/puppeteer.eventemitter.once.md new file mode 100644 index 00000000000..3334d197e6c --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.eventemitter.once.md @@ -0,0 +1,28 @@ +--- +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(event: EventType, handler: Handler): EventEmitter; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ------------------------------------- | ------------------------------------------------- | +| event | [EventType](./puppeteer.eventtype.md) | the event you'd like to listen to | +| handler | [Handler](./puppeteer.handler.md) | the handler function to run when the event occurs | + +**Returns:** + +[EventEmitter](./puppeteer.eventemitter.md) + +`this` to enable you to chain method calls. diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.eventemitter.removealllisteners.md b/website/versioned_docs/version-16.0.0/api/puppeteer.eventemitter.removealllisteners.md new file mode 100644 index 00000000000..bccda48db6f --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.eventemitter.removealllisteners.md @@ -0,0 +1,27 @@ +--- +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(event?: EventType): EventEmitter; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ------------------------------------- | ---------------------------------------------------- | +| event | [EventType](./puppeteer.eventtype.md) | (Optional) the event to remove listeners for. | + +**Returns:** + +[EventEmitter](./puppeteer.eventemitter.md) + +`this` to enable you to chain method calls. diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.eventemitter.removelistener.md b/website/versioned_docs/version-16.0.0/api/puppeteer.eventemitter.removelistener.md new file mode 100644 index 00000000000..33d797f3e03 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.eventemitter.removelistener.md @@ -0,0 +1,30 @@ +--- +sidebar_label: EventEmitter.removeListener +--- + +# EventEmitter.removeListener() method + +> Warning: This API is now obsolete. +> +> please use [EventEmitter.off()](./puppeteer.eventemitter.off.md) instead. + +Remove an event listener. + +**Signature:** + +```typescript +class EventEmitter { + removeListener(event: EventType, handler: Handler): EventEmitter; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ------------------------------------- | ----------- | +| event | [EventType](./puppeteer.eventtype.md) | | +| handler | [Handler](./puppeteer.handler.md) | | + +**Returns:** + +[EventEmitter](./puppeteer.eventemitter.md) diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.eventtype.md b/website/versioned_docs/version-16.0.0/api/puppeteer.eventtype.md new file mode 100644 index 00000000000..f60bc2027c7 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.eventtype.md @@ -0,0 +1,11 @@ +--- +sidebar_label: EventType +--- + +# EventType type + +**Signature:** + +```typescript +export declare type EventType = string | symbol; +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.executablepath.md b/website/versioned_docs/version-16.0.0/api/puppeteer.executablepath.md new file mode 100644 index 00000000000..44cc2c6c0de --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.executablepath.md @@ -0,0 +1,11 @@ +--- +sidebar_label: executablePath +--- + +# executablePath variable + +**Signature:** + +```typescript +executablePath: (channel?: string | undefined) => string; +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.executioncontext.evaluate.md b/website/versioned_docs/version-16.0.0/api/puppeteer.executioncontext.evaluate.md new file mode 100644 index 00000000000..3c7abd30581 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.executioncontext.evaluate.md @@ -0,0 +1,67 @@ +--- +sidebar_label: ExecutionContext.evaluate +--- + +# ExecutionContext.evaluate() method + +**Signature:** + +```typescript +class ExecutionContext { + evaluate< + Params extends unknown[], + Func extends EvaluateFunc = EvaluateFunc + >( + pageFunction: Func | string, + ...args: Params + ): Promise>>; +} +``` + +## Parameters + +| Parameter | Type | Description | +| ------------ | -------------- | --------------------------------------------------------------- | +| pageFunction | Func \| string | a function to be evaluated in the executionContext | +| args | Params | argument to pass to the page function | + +**Returns:** + +Promise<Awaited<ReturnType<Func>>> + +A promise that resolves to the return value of the given function. + +## Remarks + +If the function passed to the `executionContext.evaluate` returns a Promise, then `executionContext.evaluate` would wait for the promise to resolve and return its value. If the function passed to the `executionContext.evaluate` returns a non-serializable value, then `executionContext.evaluate` resolves to `undefined`. DevTools Protocol also supports transferring some additional values that are not serializable by `JSON`: `-0`, `NaN`, `Infinity`, `-Infinity`, and bigint literals. + +## Example 1 + +```ts +const executionContext = await page.mainFrame().executionContext(); +const result = await executionContext.evaluate(() => Promise.resolve(8 * 7))* ; +console.log(result); // prints "56" +``` + +## Example 2 + +A string can also be passed in instead of a function. + +```ts +console.log(await executionContext.evaluate('1 + 2')); // prints "3" +``` + +## Example 3 + +[JSHandle](./puppeteer.jshandle.md) instances can be passed as arguments to the `executionContext.* evaluate`: + +```ts +const oneHandle = await executionContext.evaluateHandle(() => 1); +const twoHandle = await executionContext.evaluateHandle(() => 2); +const result = await executionContext.evaluate( + (a, b) => a + b, oneHandle, * twoHandle +); +await oneHandle.dispose(); +await twoHandle.dispose(); +console.log(result); // prints '3'. +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.executioncontext.evaluatehandle.md b/website/versioned_docs/version-16.0.0/api/puppeteer.executioncontext.evaluatehandle.md new file mode 100644 index 00000000000..103b8d7e1ff --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.executioncontext.evaluatehandle.md @@ -0,0 +1,65 @@ +--- +sidebar_label: ExecutionContext.evaluateHandle +--- + +# ExecutionContext.evaluateHandle() method + +**Signature:** + +```typescript +class ExecutionContext { + evaluateHandle< + Params extends unknown[], + Func extends EvaluateFunc = EvaluateFunc + >( + pageFunction: Func | string, + ...args: Params + ): Promise>>>; +} +``` + +## Parameters + +| Parameter | Type | Description | +| ------------ | -------------- | --------------------------------------------------------------- | +| pageFunction | Func \| string | a function to be evaluated in the executionContext | +| args | Params | argument to pass to the page function | + +**Returns:** + +Promise<[HandleFor](./puppeteer.handlefor.md)<Awaited<ReturnType<Func>>>> + +A promise that resolves to the return value of the given function as an in-page object (a [JSHandle](./puppeteer.jshandle.md)). + +## Remarks + +The only difference between `executionContext.evaluate` and `executionContext.evaluateHandle` is that `executionContext.evaluateHandle` returns an in-page object (a [JSHandle](./puppeteer.jshandle.md)). If the function passed to the `executionContext.evaluateHandle` returns a Promise, then `executionContext.evaluateHandle` would wait for the promise to resolve and return its value. + +## Example 1 + +```ts +const context = await page.mainFrame().executionContext(); +const aHandle = await context.evaluateHandle(() => Promise.resolve(self)); +aHandle; // Handle for the global object. +``` + +## Example 2 + +A string can also be passed in instead of a function. + +```ts +// Handle for the '3' * object. +const aHandle = await context.evaluateHandle('1 + 2'); +``` + +## Example 3 + +JSHandle instances can be passed as arguments to the `executionContext.* evaluateHandle`: + +```ts +const aHandle = await context.evaluateHandle(() => document.body); +const resultHandle = await context.evaluateHandle(body => body.innerHTML, * aHandle); +console.log(await resultHandle.jsonValue()); // prints body's innerHTML +await aHandle.dispose(); +await resultHandle.dispose(); +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.executioncontext.frame.md b/website/versioned_docs/version-16.0.0/api/puppeteer.executioncontext.frame.md new file mode 100644 index 00000000000..feef9b8dbdf --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.executioncontext.frame.md @@ -0,0 +1,23 @@ +--- +sidebar_label: ExecutionContext.frame +--- + +# ExecutionContext.frame() method + +**Signature:** + +```typescript +class ExecutionContext { + frame(): Frame | null; +} +``` + +**Returns:** + +[Frame](./puppeteer.frame.md) \| null + +The frame associated with this execution context. + +## Remarks + +Not every execution context is associated with a frame. For example, workers and extensions have execution contexts that are not associated with frames. diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.executioncontext.md b/website/versioned_docs/version-16.0.0/api/puppeteer.executioncontext.md new file mode 100644 index 00000000000..a0e5999b0d7 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.executioncontext.md @@ -0,0 +1,28 @@ +--- +sidebar_label: ExecutionContext +--- + +# ExecutionContext class + +This class represents a context for JavaScript execution. A \[Page\] might have many execution contexts: - each [frame](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe) has "default" execution context that is always created after frame is attached to DOM. This context is returned by the [Frame.executionContext()](./puppeteer.frame.executioncontext.md) method. - [Extension](https://developer.chrome.com/extensions)'s content scripts create additional execution contexts. + +Besides pages, execution contexts can be found in [workers](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API). + +**Signature:** + +```typescript +export declare class ExecutionContext +``` + +## 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 `ExecutionContext` class. + +## Methods + +| Method | Modifiers | Description | +| ------------------------------------------------------------------------------------ | --------- | -------------------------------------------------------------------------------------------- | +| [evaluate(pageFunction, args)](./puppeteer.executioncontext.evaluate.md) | | | +| [evaluateHandle(pageFunction, args)](./puppeteer.executioncontext.evaluatehandle.md) | | | +| [frame()](./puppeteer.executioncontext.frame.md) | | | +| [queryObjects(prototypeHandle)](./puppeteer.executioncontext.queryobjects.md) | | This method iterates the JavaScript heap and finds all the objects with the given prototype. | diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.executioncontext.queryobjects.md b/website/versioned_docs/version-16.0.0/api/puppeteer.executioncontext.queryobjects.md new file mode 100644 index 00000000000..400fdb41048 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.executioncontext.queryobjects.md @@ -0,0 +1,46 @@ +--- +sidebar_label: ExecutionContext.queryObjects +--- + +# ExecutionContext.queryObjects() method + +This method iterates the JavaScript heap and finds all the objects with the given prototype. + +**Signature:** + +```typescript +class ExecutionContext { + queryObjects( + prototypeHandle: JSHandle + ): Promise>; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------------- | ---------------------------------------------------- | -------------------------------- | +| prototypeHandle | [JSHandle](./puppeteer.jshandle.md)<Prototype> | a handle to the object prototype | + +**Returns:** + +Promise<[HandleFor](./puppeteer.handlefor.md)<Prototype\[\]>> + +A handle to an array of objects with the given prototype. + +## Remarks + +## Example + +```ts +// Create a Map object +await page.evaluate(() => (window.map = new Map())); +// Get a handle to the Map object prototype +const mapPrototype = await page.evaluateHandle(() => Map.prototype); +// Query all map instances into an array +const mapInstances = await page.queryObjects(mapPrototype); +// Count amount of map objects in heap +const count = await page.evaluate(maps => maps.length, mapInstances); +await mapInstances.dispose(); +await mapPrototype.dispose(); +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.filechooser.accept.md b/website/versioned_docs/version-16.0.0/api/puppeteer.filechooser.accept.md new file mode 100644 index 00000000000..e1dfca40392 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.filechooser.accept.md @@ -0,0 +1,25 @@ +--- +sidebar_label: FileChooser.accept +--- + +# FileChooser.accept() method + +Accept the file chooser request with given paths. + +**Signature:** + +```typescript +class FileChooser { + accept(filePaths: string[]): Promise; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| filePaths | string\[\] | If some of the filePaths are relative paths, then they are resolved relative to the [current working directory](https://nodejs.org/api/process.html#process_process_cwd). | + +**Returns:** + +Promise<void> diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.filechooser.cancel.md b/website/versioned_docs/version-16.0.0/api/puppeteer.filechooser.cancel.md new file mode 100644 index 00000000000..64065b42a83 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.filechooser.cancel.md @@ -0,0 +1,19 @@ +--- +sidebar_label: FileChooser.cancel +--- + +# FileChooser.cancel() method + +Closes the file chooser without selecting any files. + +**Signature:** + +```typescript +class FileChooser { + cancel(): void; +} +``` + +**Returns:** + +void diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.filechooser.ismultiple.md b/website/versioned_docs/version-16.0.0/api/puppeteer.filechooser.ismultiple.md new file mode 100644 index 00000000000..0f4735cb218 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.filechooser.ismultiple.md @@ -0,0 +1,19 @@ +--- +sidebar_label: FileChooser.isMultiple +--- + +# FileChooser.isMultiple() method + +Whether file chooser allow for [multiple](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#attr-multiple) file selection. + +**Signature:** + +```typescript +class FileChooser { + isMultiple(): boolean; +} +``` + +**Returns:** + +boolean diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.filechooser.md b/website/versioned_docs/version-16.0.0/api/puppeteer.filechooser.md new file mode 100644 index 00000000000..8eaae182b2f --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.filechooser.md @@ -0,0 +1,41 @@ +--- +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` objects are returned via the `page.waitForFileChooser` 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 `FileChooser` class. + +## Example + +An example of using `FileChooser`: + +```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']); +``` + +\*\*NOTE\*\* 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. + +## Methods + +| Method | Modifiers | Description | +| ------------------------------------------------------ | --------- | --------------------------------------------------------------------------------------------------------------------------------------------- | +| [accept(filePaths)](./puppeteer.filechooser.accept.md) | | Accept the file chooser request with given 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. | diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.flattenhandle.md b/website/versioned_docs/version-16.0.0/api/puppeteer.flattenhandle.md new file mode 100644 index 00000000000..227749eabae --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.flattenhandle.md @@ -0,0 +1,13 @@ +--- +sidebar_label: FlattenHandle +--- + +# FlattenHandle type + +**Signature:** + +```typescript +export declare type FlattenHandle = T extends HandleOr ? U : never; +``` + +**References:** [HandleOr](./puppeteer.handleor.md) diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.frame._.md b/website/versioned_docs/version-16.0.0/api/puppeteer.frame._.md new file mode 100644 index 00000000000..1e29bcb8e25 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.frame._.md @@ -0,0 +1,29 @@ +--- +sidebar_label: Frame.$ +--- + +# Frame.$() method + +This method queries the frame for the given selector. + +**Signature:** + +```typescript +class Frame { + $( + selector: Selector + ): Promise> | null>; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | -------- | ------------------------ | +| selector | Selector | a selector to query for. | + +**Returns:** + +Promise<[ElementHandle](./puppeteer.elementhandle.md)<[NodeFor](./puppeteer.nodefor.md)<Selector>> \| null> + +A promise which resolves to an `ElementHandle` pointing at the element, or `null` if it was not found. diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.frame.__.md b/website/versioned_docs/version-16.0.0/api/puppeteer.frame.__.md new file mode 100644 index 00000000000..7b296cbd2c1 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.frame.__.md @@ -0,0 +1,29 @@ +--- +sidebar_label: Frame.$$ +--- + +# Frame.$$() method + +This runs `document.querySelectorAll` in the frame and returns the result. + +**Signature:** + +```typescript +class Frame { + $$( + selector: Selector + ): Promise>>>; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | -------- | ------------------------ | +| selector | Selector | a selector to search for | + +**Returns:** + +Promise<Array<[ElementHandle](./puppeteer.elementhandle.md)<[NodeFor](./puppeteer.nodefor.md)<Selector>>>> + +An array of element handles pointing to the found frame elements. diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.frame.__eval.md b/website/versioned_docs/version-16.0.0/api/puppeteer.frame.__eval.md new file mode 100644 index 00000000000..6db54e4ed69 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.frame.__eval.md @@ -0,0 +1,47 @@ +--- +sidebar_label: Frame.$$eval +--- + +# Frame.$$eval() method + +**Signature:** + +```typescript +class Frame { + $$eval< + Selector extends string, + Params extends unknown[], + Func extends EvaluateFunc< + [Array>, ...Params] + > = EvaluateFunc<[Array>, ...Params]> + >( + selector: Selector, + pageFunction: Func | string, + ...args: Params + ): Promise>>; +} +``` + +## Parameters + +| Parameter | Type | Description | +| ------------ | -------------- | --------------------------------------------------------- | +| selector | Selector | the selector to query for | +| pageFunction | Func \| string | the function to be evaluated in the frame's context | +| args | Params | additional arguments to pass to pageFunction | + +**Returns:** + +Promise<Awaited<ReturnType<Func>>> + +## Remarks + +This method runs `Array.from(document.querySelectorAll(selector))` within the frame and passes it as the first argument to `pageFunction`. + +If `pageFunction` returns a Promise, then `frame.$$eval` would wait for the promise to resolve and return its value. + +## Example + +```ts +const divsCounts = await frame.$$eval('div', divs => divs.length); +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.frame._eval.md b/website/versioned_docs/version-16.0.0/api/puppeteer.frame._eval.md new file mode 100644 index 00000000000..28ead092bb7 --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.frame._eval.md @@ -0,0 +1,47 @@ +--- +sidebar_label: Frame.$eval +--- + +# Frame.$eval() method + +**Signature:** + +```typescript +class Frame { + $eval< + Selector extends string, + Params extends unknown[], + Func extends EvaluateFunc< + [ElementHandle>, ...Params] + > = EvaluateFunc<[ElementHandle>, ...Params]> + >( + selector: Selector, + pageFunction: Func | string, + ...args: Params + ): Promise>>; +} +``` + +## Parameters + +| Parameter | Type | Description | +| ------------ | -------------- | --------------------------------------------------------- | +| selector | Selector | the selector to query for | +| pageFunction | Func \| string | the function to be evaluated in the frame's context | +| args | Params | additional arguments to pass to pageFunction | + +**Returns:** + +Promise<Awaited<ReturnType<Func>>> + +## Remarks + +This method runs `document.querySelector` within the frame and passes it as the first argument to `pageFunction`. + +If `pageFunction` returns a Promise, then `frame.$eval` would wait for the promise to resolve and return its value. + +## Example + +```ts +const searchValue = await frame.$eval('#search', el => el.value); +``` diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.frame._x.md b/website/versioned_docs/version-16.0.0/api/puppeteer.frame._x.md new file mode 100644 index 00000000000..e2290048e6d --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.frame._x.md @@ -0,0 +1,25 @@ +--- +sidebar_label: Frame.$x +--- + +# Frame.$x() method + +This method evaluates the given XPath expression and returns the results. + +**Signature:** + +```typescript +class Frame { + $x(expression: string): Promise>>; +} +``` + +## Parameters + +| Parameter | Type | Description | +| ---------- | ------ | --------------------------------- | +| expression | string | the XPath expression to evaluate. | + +**Returns:** + +Promise<Array<[ElementHandle](./puppeteer.elementhandle.md)<Node>>> diff --git a/website/versioned_docs/version-16.0.0/api/puppeteer.frame.addscripttag.md b/website/versioned_docs/version-16.0.0/api/puppeteer.frame.addscripttag.md new file mode 100644 index 00000000000..3baf564eabf --- /dev/null +++ b/website/versioned_docs/version-16.0.0/api/puppeteer.frame.addscripttag.md @@ -0,0 +1,29 @@ +--- +sidebar_label: Frame.addScriptTag +--- + +# Frame.addScriptTag() method + +Adds a `