diff --git a/src/common/Page.ts b/src/common/Page.ts index d8ad85b30e1..c5caaaf57ba 100644 --- a/src/common/Page.ts +++ b/src/common/Page.ts @@ -201,7 +201,9 @@ export interface ScreenshotOptions { * @public */ export const enum PageEmittedEvents { - /** Emitted when the page closes. */ + /** Emitted when the page closes. + * @eventProperty + */ Close = 'close', /** * Emitted when JavaScript within the page calls one of console API methods, diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index 85cd2470305..94cdc36a478 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -22,7 +22,7 @@ module.exports = { tagline: 'Note: this documentation is WIP. Please use https://pptr.dev.', url: 'https://puppeteer.github.io/', baseUrl: '/puppeteer/', - onBrokenLinks: 'ignore', + onBrokenLinks: 'warn', onBrokenMarkdownLinks: 'ignore', favicon: 'img/favicon.ico', organizationName: 'puppeteer', // Usually your GitHub org/user name. @@ -48,6 +48,9 @@ module.exports = { label: 'Contribute', position: 'left', }, + { + type: 'docsVersionDropdown', + }, { label: 'Github', href: 'https://github.com/puppeteer/puppeteer', diff --git a/website/sidebars.js b/website/sidebars.js index cc9eaea9324..ef28c265253 100644 --- a/website/sidebars.js +++ b/website/sidebars.js @@ -471,6 +471,11 @@ module.exports = { id: 'puppeteer.page.metrics', label: 'metrics', }, + { + type: 'doc', + id: 'puppeteer.page.once', + label: 'once', + }, { type: 'doc', id: 'puppeteer.page.pdf', diff --git a/website/versioned_docs/version-10.0.0/index.md b/website/versioned_docs/version-10.0.0/index.md new file mode 100644 index 00000000000..ee99080bb52 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/index.md @@ -0,0 +1,12 @@ + + +[Home](./index.md) + +## API Reference + +## Packages + +| Package | Description | +| --- | --- | +| [puppeteer](./puppeteer.md) | | + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.accessibility.md b/website/versioned_docs/version-10.0.0/puppeteer.accessibility.md new file mode 100644 index 00000000000..45f0550e40f --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.accessibility.md @@ -0,0 +1,30 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Accessibility](./puppeteer.accessibility.md) + +## 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-10.0.0/puppeteer.accessibility.snapshot.md b/website/versioned_docs/version-10.0.0/puppeteer.accessibility.snapshot.md new file mode 100644 index 00000000000..5304955f2dd --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.accessibility.snapshot.md @@ -0,0 +1,61 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Accessibility](./puppeteer.accessibility.md) > [snapshot](./puppeteer.accessibility.snapshot.md) + +## Accessibility.snapshot() method + +Captures the current state of the accessibility tree. The returned object represents the root accessible node of the page. + +Signature: + +```typescript +snapshot(options?: SnapshotOptions): Promise; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| options | [SnapshotOptions](./puppeteer.snapshotoptions.md) | | + +Returns: + +Promise<[SerializedAXNode](./puppeteer.serializedaxnode.md)> + +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: + +```js +const snapshot = await page.accessibility.snapshot(); +console.log(snapshot); + +``` + +## Example 2 + +An example of logging the focused node's name: + +```js +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-10.0.0/puppeteer.actionresult.md b/website/versioned_docs/version-10.0.0/puppeteer.actionresult.md new file mode 100644 index 00000000000..e8e6334dace --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.actionresult.md @@ -0,0 +1,12 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ActionResult](./puppeteer.actionresult.md) + +## ActionResult type + + +Signature: + +```typescript +export declare type ActionResult = 'continue' | 'abort' | 'respond'; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.boundingbox.height.md b/website/versioned_docs/version-10.0.0/puppeteer.boundingbox.height.md new file mode 100644 index 00000000000..9fb33326555 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.boundingbox.height.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [BoundingBox](./puppeteer.boundingbox.md) > [height](./puppeteer.boundingbox.height.md) + +## BoundingBox.height property + +the height of the element in pixels. + +Signature: + +```typescript +height: number; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.boundingbox.md b/website/versioned_docs/version-10.0.0/puppeteer.boundingbox.md new file mode 100644 index 00000000000..3ff86372918 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.boundingbox.md @@ -0,0 +1,22 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [BoundingBox](./puppeteer.boundingbox.md) + +## BoundingBox interface + + +Signature: + +```typescript +export interface BoundingBox +``` + +## Properties + +| Property | 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. | +| [x](./puppeteer.boundingbox.x.md) | number | the x coordinate of the element in pixels. | +| [y](./puppeteer.boundingbox.y.md) | number | the y coordinate of the element in pixels. | + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.boundingbox.width.md b/website/versioned_docs/version-10.0.0/puppeteer.boundingbox.width.md new file mode 100644 index 00000000000..f0fc401e4c9 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.boundingbox.width.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [BoundingBox](./puppeteer.boundingbox.md) > [width](./puppeteer.boundingbox.width.md) + +## BoundingBox.width property + +the width of the element in pixels. + +Signature: + +```typescript +width: number; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.boundingbox.x.md b/website/versioned_docs/version-10.0.0/puppeteer.boundingbox.x.md new file mode 100644 index 00000000000..b64a4bdb3c8 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.boundingbox.x.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [BoundingBox](./puppeteer.boundingbox.md) > [x](./puppeteer.boundingbox.x.md) + +## BoundingBox.x property + +the x coordinate of the element in pixels. + +Signature: + +```typescript +x: number; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.boundingbox.y.md b/website/versioned_docs/version-10.0.0/puppeteer.boundingbox.y.md new file mode 100644 index 00000000000..73194ab6299 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.boundingbox.y.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [BoundingBox](./puppeteer.boundingbox.md) > [y](./puppeteer.boundingbox.y.md) + +## BoundingBox.y property + +the y coordinate of the element in pixels. + +Signature: + +```typescript +y: number; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.boxmodel.border.md b/website/versioned_docs/version-10.0.0/puppeteer.boxmodel.border.md new file mode 100644 index 00000000000..7c0d7c2b930 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.boxmodel.border.md @@ -0,0 +1,14 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [BoxModel](./puppeteer.boxmodel.md) > [border](./puppeteer.boxmodel.border.md) + +## BoxModel.border property + +Signature: + +```typescript +border: Array<{ + x: number; + y: number; + }>; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.boxmodel.content.md b/website/versioned_docs/version-10.0.0/puppeteer.boxmodel.content.md new file mode 100644 index 00000000000..1abc3e8598e --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.boxmodel.content.md @@ -0,0 +1,14 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [BoxModel](./puppeteer.boxmodel.md) > [content](./puppeteer.boxmodel.content.md) + +## BoxModel.content property + +Signature: + +```typescript +content: Array<{ + x: number; + y: number; + }>; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.boxmodel.height.md b/website/versioned_docs/version-10.0.0/puppeteer.boxmodel.height.md new file mode 100644 index 00000000000..c28cb8bf53c --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.boxmodel.height.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [BoxModel](./puppeteer.boxmodel.md) > [height](./puppeteer.boxmodel.height.md) + +## BoxModel.height property + +Signature: + +```typescript +height: number; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.boxmodel.margin.md b/website/versioned_docs/version-10.0.0/puppeteer.boxmodel.margin.md new file mode 100644 index 00000000000..876a8d089f8 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.boxmodel.margin.md @@ -0,0 +1,14 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [BoxModel](./puppeteer.boxmodel.md) > [margin](./puppeteer.boxmodel.margin.md) + +## BoxModel.margin property + +Signature: + +```typescript +margin: Array<{ + x: number; + y: number; + }>; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.boxmodel.md b/website/versioned_docs/version-10.0.0/puppeteer.boxmodel.md new file mode 100644 index 00000000000..eadbcab83e2 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.boxmodel.md @@ -0,0 +1,24 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [BoxModel](./puppeteer.boxmodel.md) + +## BoxModel interface + + +Signature: + +```typescript +export interface BoxModel +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [border](./puppeteer.boxmodel.border.md) | Array<{ x: number; y: number; }> | | +| [content](./puppeteer.boxmodel.content.md) | Array<{ x: number; y: number; }> | | +| [height](./puppeteer.boxmodel.height.md) | number | | +| [margin](./puppeteer.boxmodel.margin.md) | Array<{ x: number; y: number; }> | | +| [padding](./puppeteer.boxmodel.padding.md) | Array<{ x: number; y: number; }> | | +| [width](./puppeteer.boxmodel.width.md) | number | | + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.boxmodel.padding.md b/website/versioned_docs/version-10.0.0/puppeteer.boxmodel.padding.md new file mode 100644 index 00000000000..11761bb412d --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.boxmodel.padding.md @@ -0,0 +1,14 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [BoxModel](./puppeteer.boxmodel.md) > [padding](./puppeteer.boxmodel.padding.md) + +## BoxModel.padding property + +Signature: + +```typescript +padding: Array<{ + x: number; + y: number; + }>; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.boxmodel.width.md b/website/versioned_docs/version-10.0.0/puppeteer.boxmodel.width.md new file mode 100644 index 00000000000..4e9cfb3239d --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.boxmodel.width.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [BoxModel](./puppeteer.boxmodel.md) > [width](./puppeteer.boxmodel.width.md) + +## BoxModel.width property + +Signature: + +```typescript +width: number; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.browser.browsercontexts.md b/website/versioned_docs/version-10.0.0/puppeteer.browser.browsercontexts.md new file mode 100644 index 00000000000..4ec2e04d917 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.browser.browsercontexts.md @@ -0,0 +1,17 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Browser](./puppeteer.browser.md) > [browserContexts](./puppeteer.browser.browsercontexts.md) + +## 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 +browserContexts(): BrowserContext[]; +``` +Returns: + +[BrowserContext](./puppeteer.browsercontext.md)\[\] + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.browser.close.md b/website/versioned_docs/version-10.0.0/puppeteer.browser.close.md new file mode 100644 index 00000000000..725492710b0 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.browser.close.md @@ -0,0 +1,17 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Browser](./puppeteer.browser.md) > [close](./puppeteer.browser.close.md) + +## 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 +close(): Promise; +``` +Returns: + +Promise<void> + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.browser.createincognitobrowsercontext.md b/website/versioned_docs/version-10.0.0/puppeteer.browser.createincognitobrowsercontext.md new file mode 100644 index 00000000000..8bd4f9ebed3 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.browser.createincognitobrowsercontext.md @@ -0,0 +1,33 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Browser](./puppeteer.browser.md) > [createIncognitoBrowserContext](./puppeteer.browser.createincognitobrowsercontext.md) + +## Browser.createIncognitoBrowserContext() method + +Creates a new incognito browser context. This won't share cookies/cache with other browser contexts. + +Signature: + +```typescript +createIncognitoBrowserContext(): Promise; +``` +Returns: + +Promise<[BrowserContext](./puppeteer.browsercontext.md)> + +## Example + + +```js +(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-10.0.0/puppeteer.browser.defaultbrowsercontext.md b/website/versioned_docs/version-10.0.0/puppeteer.browser.defaultbrowsercontext.md new file mode 100644 index 00000000000..92fd82c8174 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.browser.defaultbrowsercontext.md @@ -0,0 +1,17 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Browser](./puppeteer.browser.md) > [defaultBrowserContext](./puppeteer.browser.defaultbrowsercontext.md) + +## Browser.defaultBrowserContext() method + +Returns the default browser context. The default browser context cannot be closed. + +Signature: + +```typescript +defaultBrowserContext(): BrowserContext; +``` +Returns: + +[BrowserContext](./puppeteer.browsercontext.md) + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.browser.disconnect.md b/website/versioned_docs/version-10.0.0/puppeteer.browser.disconnect.md new file mode 100644 index 00000000000..2b4a3f9f80f --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.browser.disconnect.md @@ -0,0 +1,17 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Browser](./puppeteer.browser.md) > [disconnect](./puppeteer.browser.disconnect.md) + +## 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 +disconnect(): void; +``` +Returns: + +void + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.browser.isconnected.md b/website/versioned_docs/version-10.0.0/puppeteer.browser.isconnected.md new file mode 100644 index 00000000000..756998990e5 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.browser.isconnected.md @@ -0,0 +1,17 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Browser](./puppeteer.browser.md) > [isConnected](./puppeteer.browser.isconnected.md) + +## Browser.isConnected() method + +Indicates that the browser is connected. + +Signature: + +```typescript +isConnected(): boolean; +``` +Returns: + +boolean + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.browser.md b/website/versioned_docs/version-10.0.0/puppeteer.browser.md new file mode 100644 index 00000000000..9d001d205df --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.browser.md @@ -0,0 +1,79 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Browser](./puppeteer.browser.md) + +## 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): + +```js +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): + +```js +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()](./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-10.0.0/puppeteer.browser.newpage.md b/website/versioned_docs/version-10.0.0/puppeteer.browser.newpage.md new file mode 100644 index 00000000000..7a4b47ef1fb --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.browser.newpage.md @@ -0,0 +1,17 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Browser](./puppeteer.browser.md) > [newPage](./puppeteer.browser.newpage.md) + +## 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 +newPage(): Promise; +``` +Returns: + +Promise<[Page](./puppeteer.page.md)> + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.browser.pages.md b/website/versioned_docs/version-10.0.0/puppeteer.browser.pages.md new file mode 100644 index 00000000000..f16533c0fc9 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.browser.pages.md @@ -0,0 +1,21 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Browser](./puppeteer.browser.md) > [pages](./puppeteer.browser.pages.md) + +## Browser.pages() method + +An array of all open pages inside the Browser. + +Signature: + +```typescript +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-10.0.0/puppeteer.browser.process.md b/website/versioned_docs/version-10.0.0/puppeteer.browser.process.md new file mode 100644 index 00000000000..5b34ad71cea --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.browser.process.md @@ -0,0 +1,17 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Browser](./puppeteer.browser.md) > [process](./puppeteer.browser.process.md) + +## Browser.process() method + +The spawned browser process. Returns `null` if the browser instance was created with [Puppeteer.connect()](./puppeteer.puppeteer.connect.md). + +Signature: + +```typescript +process(): ChildProcess | null; +``` +Returns: + +ChildProcess \| null + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.browser.target.md b/website/versioned_docs/version-10.0.0/puppeteer.browser.target.md new file mode 100644 index 00000000000..0546aace490 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.browser.target.md @@ -0,0 +1,17 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Browser](./puppeteer.browser.md) > [target](./puppeteer.browser.target.md) + +## Browser.target() method + +The target associated with the browser. + +Signature: + +```typescript +target(): Target; +``` +Returns: + +[Target](./puppeteer.target.md) + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.browser.targets.md b/website/versioned_docs/version-10.0.0/puppeteer.browser.targets.md new file mode 100644 index 00000000000..14eb2d4a175 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.browser.targets.md @@ -0,0 +1,17 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Browser](./puppeteer.browser.md) > [targets](./puppeteer.browser.targets.md) + +## 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 +targets(): Target[]; +``` +Returns: + +[Target](./puppeteer.target.md)\[\] + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.browser.useragent.md b/website/versioned_docs/version-10.0.0/puppeteer.browser.useragent.md new file mode 100644 index 00000000000..ae1f1f5919d --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.browser.useragent.md @@ -0,0 +1,17 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Browser](./puppeteer.browser.md) > [userAgent](./puppeteer.browser.useragent.md) + +## 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 +userAgent(): Promise; +``` +Returns: + +Promise<string> + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.browser.version.md b/website/versioned_docs/version-10.0.0/puppeteer.browser.version.md new file mode 100644 index 00000000000..8e2f3e5b048 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.browser.version.md @@ -0,0 +1,23 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Browser](./puppeteer.browser.md) > [version](./puppeteer.browser.version.md) + +## Browser.version() method + +A string representing the browser name and version. + +Signature: + +```typescript +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-10.0.0/puppeteer.browser.waitfortarget.md b/website/versioned_docs/version-10.0.0/puppeteer.browser.waitfortarget.md new file mode 100644 index 00000000000..a607dcbc981 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.browser.waitfortarget.md @@ -0,0 +1,37 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Browser](./puppeteer.browser.md) > [waitForTarget](./puppeteer.browser.waitfortarget.md) + +## Browser.waitForTarget() method + +Searches for a target in all browser contexts. + +Signature: + +```typescript +waitForTarget(predicate: (x: Target) => boolean, options?: WaitForTargetOptions): Promise; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| predicate | (x: [Target](./puppeteer.target.md)) => boolean | A function to be run for every target. | +| options | [WaitForTargetOptions](./puppeteer.waitfortargetoptions.md) | | + +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`: + +```js +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-10.0.0/puppeteer.browser.wsendpoint.md b/website/versioned_docs/version-10.0.0/puppeteer.browser.wsendpoint.md new file mode 100644 index 00000000000..751cad5c180 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.browser.wsendpoint.md @@ -0,0 +1,25 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Browser](./puppeteer.browser.md) > [wsEndpoint](./puppeteer.browser.wsendpoint.md) + +## Browser.wsEndpoint() method + +The browser websocket endpoint which can be used as an argument to [Puppeteer.connect()](./puppeteer.puppeteer.connect.md). + +Signature: + +```typescript +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-10.0.0/puppeteer.browserconnectoptions.defaultviewport.md b/website/versioned_docs/version-10.0.0/puppeteer.browserconnectoptions.defaultviewport.md new file mode 100644 index 00000000000..d610fd65fa4 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.browserconnectoptions.defaultviewport.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserConnectOptions](./puppeteer.browserconnectoptions.md) > [defaultViewport](./puppeteer.browserconnectoptions.defaultviewport.md) + +## BrowserConnectOptions.defaultViewport property + +Sets the viewport for each page. + +Signature: + +```typescript +defaultViewport?: Viewport | null; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.browserconnectoptions.ignorehttpserrors.md b/website/versioned_docs/version-10.0.0/puppeteer.browserconnectoptions.ignorehttpserrors.md new file mode 100644 index 00000000000..627cbe2c956 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.browserconnectoptions.ignorehttpserrors.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserConnectOptions](./puppeteer.browserconnectoptions.md) > [ignoreHTTPSErrors](./puppeteer.browserconnectoptions.ignorehttpserrors.md) + +## BrowserConnectOptions.ignoreHTTPSErrors property + +Whether to ignore HTTPS errors during navigation. + +Signature: + +```typescript +ignoreHTTPSErrors?: boolean; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.browserconnectoptions.md b/website/versioned_docs/version-10.0.0/puppeteer.browserconnectoptions.md new file mode 100644 index 00000000000..c473f69d559 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.browserconnectoptions.md @@ -0,0 +1,23 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserConnectOptions](./puppeteer.browserconnectoptions.md) + +## 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 | 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-10.0.0/puppeteer.browserconnectoptions.slowmo.md b/website/versioned_docs/version-10.0.0/puppeteer.browserconnectoptions.slowmo.md new file mode 100644 index 00000000000..f0eacae0935 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.browserconnectoptions.slowmo.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserConnectOptions](./puppeteer.browserconnectoptions.md) > [slowMo](./puppeteer.browserconnectoptions.slowmo.md) + +## BrowserConnectOptions.slowMo property + +Slows down Puppeteer operations by the specified amount of milliseconds to aid debugging. + +Signature: + +```typescript +slowMo?: number; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.browserconnectoptions.targetfilter.md b/website/versioned_docs/version-10.0.0/puppeteer.browserconnectoptions.targetfilter.md new file mode 100644 index 00000000000..6c58b075a78 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.browserconnectoptions.targetfilter.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserConnectOptions](./puppeteer.browserconnectoptions.md) > [targetFilter](./puppeteer.browserconnectoptions.targetfilter.md) + +## BrowserConnectOptions.targetFilter property + +Callback to decide if Puppeteer should connect to a given target or not. + +Signature: + +```typescript +targetFilter?: TargetFilterCallback; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.browsercontext.browser.md b/website/versioned_docs/version-10.0.0/puppeteer.browsercontext.browser.md new file mode 100644 index 00000000000..85dadca18e3 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.browsercontext.browser.md @@ -0,0 +1,17 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserContext](./puppeteer.browsercontext.md) > [browser](./puppeteer.browsercontext.browser.md) + +## BrowserContext.browser() method + +The browser this browser context belongs to. + +Signature: + +```typescript +browser(): Browser; +``` +Returns: + +[Browser](./puppeteer.browser.md) + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.browsercontext.clearpermissionoverrides.md b/website/versioned_docs/version-10.0.0/puppeteer.browsercontext.clearpermissionoverrides.md new file mode 100644 index 00000000000..85872769eb8 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.browsercontext.clearpermissionoverrides.md @@ -0,0 +1,28 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserContext](./puppeteer.browsercontext.md) > [clearPermissionOverrides](./puppeteer.browsercontext.clearpermissionoverrides.md) + +## BrowserContext.clearPermissionOverrides() method + +Clears all permission overrides for the browser context. + +Signature: + +```typescript +clearPermissionOverrides(): Promise; +``` +Returns: + +Promise<void> + +## Example + + +```js +const context = browser.defaultBrowserContext(); +context.overridePermissions('https://example.com', ['clipboard-read']); +// do stuff .. +context.clearPermissionOverrides(); + +``` + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.browsercontext.close.md b/website/versioned_docs/version-10.0.0/puppeteer.browsercontext.close.md new file mode 100644 index 00000000000..7b6a9c75f26 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.browsercontext.close.md @@ -0,0 +1,21 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserContext](./puppeteer.browsercontext.md) > [close](./puppeteer.browsercontext.close.md) + +## BrowserContext.close() method + +Closes the browser context. All the targets that belong to the browser context will be closed. + +Signature: + +```typescript +close(): Promise; +``` +Returns: + +Promise<void> + +## Remarks + +Only incognito browser contexts can be closed. + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.browsercontext.isincognito.md b/website/versioned_docs/version-10.0.0/puppeteer.browsercontext.isincognito.md new file mode 100644 index 00000000000..412665d0386 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.browsercontext.isincognito.md @@ -0,0 +1,21 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserContext](./puppeteer.browsercontext.md) > [isIncognito](./puppeteer.browsercontext.isincognito.md) + +## BrowserContext.isIncognito() method + +Returns whether BrowserContext is incognito. The default browser context is the only non-incognito browser context. + +Signature: + +```typescript +isIncognito(): boolean; +``` +Returns: + +boolean + +## Remarks + +The default browser context cannot be closed. + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.browsercontext.md b/website/versioned_docs/version-10.0.0/puppeteer.browsercontext.md new file mode 100644 index 00000000000..3379d33dc6d --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.browsercontext.md @@ -0,0 +1,54 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserContext](./puppeteer.browsercontext.md) + +## 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 + + +```js +// 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-10.0.0/puppeteer.browsercontext.newpage.md b/website/versioned_docs/version-10.0.0/puppeteer.browsercontext.newpage.md new file mode 100644 index 00000000000..440e0e01214 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.browsercontext.newpage.md @@ -0,0 +1,17 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserContext](./puppeteer.browsercontext.md) > [newPage](./puppeteer.browsercontext.newpage.md) + +## BrowserContext.newPage() method + +Creates a new page in the browser context. + +Signature: + +```typescript +newPage(): Promise; +``` +Returns: + +Promise<[Page](./puppeteer.page.md)> + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.browsercontext.overridepermissions.md b/website/versioned_docs/version-10.0.0/puppeteer.browsercontext.overridepermissions.md new file mode 100644 index 00000000000..a79725be37d --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.browsercontext.overridepermissions.md @@ -0,0 +1,32 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserContext](./puppeteer.browsercontext.md) > [overridePermissions](./puppeteer.browsercontext.overridepermissions.md) + +## BrowserContext.overridePermissions() method + +Signature: + +```typescript +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 + + +```js +const context = browser.defaultBrowserContext(); +await context.overridePermissions('https://html5demos.com', ['geolocation']); + +``` + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.browsercontext.pages.md b/website/versioned_docs/version-10.0.0/puppeteer.browsercontext.pages.md new file mode 100644 index 00000000000..b56ec861383 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.browsercontext.pages.md @@ -0,0 +1,19 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserContext](./puppeteer.browsercontext.md) > [pages](./puppeteer.browsercontext.pages.md) + +## BrowserContext.pages() method + +An array of all pages inside the browser context. + +Signature: + +```typescript +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-10.0.0/puppeteer.browsercontext.targets.md b/website/versioned_docs/version-10.0.0/puppeteer.browsercontext.targets.md new file mode 100644 index 00000000000..b3bb64d8829 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.browsercontext.targets.md @@ -0,0 +1,17 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserContext](./puppeteer.browsercontext.md) > [targets](./puppeteer.browsercontext.targets.md) + +## BrowserContext.targets() method + +An array of all active targets inside the browser context. + +Signature: + +```typescript +targets(): Target[]; +``` +Returns: + +[Target](./puppeteer.target.md)\[\] + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.browsercontext.waitfortarget.md b/website/versioned_docs/version-10.0.0/puppeteer.browsercontext.waitfortarget.md new file mode 100644 index 00000000000..46f3fee4493 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.browsercontext.waitfortarget.md @@ -0,0 +1,39 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserContext](./puppeteer.browsercontext.md) > [waitForTarget](./puppeteer.browsercontext.waitfortarget.md) + +## BrowserContext.waitForTarget() method + +This searches for a target in this specific browser context. + +Signature: + +```typescript +waitForTarget(predicate: (x: Target) => boolean, options?: { + timeout?: number; + }): Promise; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| predicate | (x: [Target](./puppeteer.target.md)) => boolean | A function to be run for every target | +| options | { timeout?: number; } | 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`: + +```js +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-10.0.0/puppeteer.browsercontextemittedevents.md b/website/versioned_docs/version-10.0.0/puppeteer.browsercontextemittedevents.md new file mode 100644 index 00000000000..2302875de65 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.browsercontextemittedevents.md @@ -0,0 +1,21 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserContextEmittedEvents](./puppeteer.browsercontextemittedevents.md) + +## 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-10.0.0/puppeteer.browseremittedevents.md b/website/versioned_docs/version-10.0.0/puppeteer.browseremittedevents.md new file mode 100644 index 00000000000..779d0ba75df --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.browseremittedevents.md @@ -0,0 +1,23 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserEmittedEvents](./puppeteer.browseremittedevents.md) + +## 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-10.0.0/puppeteer.browserfetcher.candownload.md b/website/versioned_docs/version-10.0.0/puppeteer.browserfetcher.candownload.md new file mode 100644 index 00000000000..11da9ded7e7 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.browserfetcher.candownload.md @@ -0,0 +1,30 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserFetcher](./puppeteer.browserfetcher.md) > [canDownload](./puppeteer.browserfetcher.candownload.md) + +## BrowserFetcher.canDownload() method + +Initiates a HEAD request to check if the revision is available. + +Signature: + +```typescript +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-10.0.0/puppeteer.browserfetcher.download.md b/website/versioned_docs/version-10.0.0/puppeteer.browserfetcher.download.md new file mode 100644 index 00000000000..d026a7cfe19 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.browserfetcher.download.md @@ -0,0 +1,31 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserFetcher](./puppeteer.browserfetcher.md) > [download](./puppeteer.browserfetcher.download.md) + +## BrowserFetcher.download() method + +Initiates a GET request to download the revision from the host. + +Signature: + +```typescript +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 | 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)> + +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-10.0.0/puppeteer.browserfetcher.host.md b/website/versioned_docs/version-10.0.0/puppeteer.browserfetcher.host.md new file mode 100644 index 00000000000..863932bf096 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.browserfetcher.host.md @@ -0,0 +1,17 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserFetcher](./puppeteer.browserfetcher.md) > [host](./puppeteer.browserfetcher.host.md) + +## BrowserFetcher.host() method + +Signature: + +```typescript +host(): string; +``` +Returns: + +string + +The download host being used. + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.browserfetcher.localrevisions.md b/website/versioned_docs/version-10.0.0/puppeteer.browserfetcher.localrevisions.md new file mode 100644 index 00000000000..e0a9bb93c02 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.browserfetcher.localrevisions.md @@ -0,0 +1,21 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserFetcher](./puppeteer.browserfetcher.md) > [localRevisions](./puppeteer.browserfetcher.localrevisions.md) + +## BrowserFetcher.localRevisions() method + +Signature: + +```typescript +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-10.0.0/puppeteer.browserfetcher.md b/website/versioned_docs/version-10.0.0/puppeteer.browserfetcher.md new file mode 100644 index 00000000000..0b674fc12a5 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.browserfetcher.md @@ -0,0 +1,45 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserFetcher](./puppeteer.browserfetcher.md) + +## 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: + +```js +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-10.0.0/puppeteer.browserfetcher.platform.md b/website/versioned_docs/version-10.0.0/puppeteer.browserfetcher.platform.md new file mode 100644 index 00000000000..c02300923e8 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.browserfetcher.platform.md @@ -0,0 +1,17 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserFetcher](./puppeteer.browserfetcher.md) > [platform](./puppeteer.browserfetcher.platform.md) + +## BrowserFetcher.platform() method + +Signature: + +```typescript +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-10.0.0/puppeteer.browserfetcher.product.md b/website/versioned_docs/version-10.0.0/puppeteer.browserfetcher.product.md new file mode 100644 index 00000000000..42fe893feca --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.browserfetcher.product.md @@ -0,0 +1,17 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserFetcher](./puppeteer.browserfetcher.md) > [product](./puppeteer.browserfetcher.product.md) + +## BrowserFetcher.product() method + +Signature: + +```typescript +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-10.0.0/puppeteer.browserfetcher.remove.md b/website/versioned_docs/version-10.0.0/puppeteer.browserfetcher.remove.md new file mode 100644 index 00000000000..9577aada683 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.browserfetcher.remove.md @@ -0,0 +1,28 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserFetcher](./puppeteer.browserfetcher.md) > [remove](./puppeteer.browserfetcher.remove.md) + +## BrowserFetcher.remove() method + +Signature: + +```typescript +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-10.0.0/puppeteer.browserfetcher.revisioninfo.md b/website/versioned_docs/version-10.0.0/puppeteer.browserfetcher.revisioninfo.md new file mode 100644 index 00000000000..6b1636b8ab9 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.browserfetcher.revisioninfo.md @@ -0,0 +1,24 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserFetcher](./puppeteer.browserfetcher.md) > [revisionInfo](./puppeteer.browserfetcher.revisioninfo.md) + +## BrowserFetcher.revisionInfo() method + +Signature: + +```typescript +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-10.0.0/puppeteer.browserfetcheroptions.host.md b/website/versioned_docs/version-10.0.0/puppeteer.browserfetcheroptions.host.md new file mode 100644 index 00000000000..c30723c16de --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.browserfetcheroptions.host.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserFetcherOptions](./puppeteer.browserfetcheroptions.md) > [host](./puppeteer.browserfetcheroptions.host.md) + +## BrowserFetcherOptions.host property + +Signature: + +```typescript +host?: string; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.browserfetcheroptions.md b/website/versioned_docs/version-10.0.0/puppeteer.browserfetcheroptions.md new file mode 100644 index 00000000000..16d69d64822 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.browserfetcheroptions.md @@ -0,0 +1,22 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserFetcherOptions](./puppeteer.browserfetcheroptions.md) + +## BrowserFetcherOptions interface + + +Signature: + +```typescript +export interface BrowserFetcherOptions +``` + +## Properties + +| Property | 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-10.0.0/puppeteer.browserfetcheroptions.path.md b/website/versioned_docs/version-10.0.0/puppeteer.browserfetcheroptions.path.md new file mode 100644 index 00000000000..e6a4bcdb265 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.browserfetcheroptions.path.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserFetcherOptions](./puppeteer.browserfetcheroptions.md) > [path](./puppeteer.browserfetcheroptions.path.md) + +## BrowserFetcherOptions.path property + +Signature: + +```typescript +path?: string; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.browserfetcheroptions.platform.md b/website/versioned_docs/version-10.0.0/puppeteer.browserfetcheroptions.platform.md new file mode 100644 index 00000000000..b37d0ead489 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.browserfetcheroptions.platform.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserFetcherOptions](./puppeteer.browserfetcheroptions.md) > [platform](./puppeteer.browserfetcheroptions.platform.md) + +## BrowserFetcherOptions.platform property + +Signature: + +```typescript +platform?: Platform; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.browserfetcheroptions.product.md b/website/versioned_docs/version-10.0.0/puppeteer.browserfetcheroptions.product.md new file mode 100644 index 00000000000..c5caa876ac8 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.browserfetcheroptions.product.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserFetcherOptions](./puppeteer.browserfetcheroptions.md) > [product](./puppeteer.browserfetcheroptions.product.md) + +## BrowserFetcherOptions.product property + +Signature: + +```typescript +product?: string; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.browserfetcherrevisioninfo.executablepath.md b/website/versioned_docs/version-10.0.0/puppeteer.browserfetcherrevisioninfo.executablepath.md new file mode 100644 index 00000000000..22e8fbfb6f6 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.browserfetcherrevisioninfo.executablepath.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserFetcherRevisionInfo](./puppeteer.browserfetcherrevisioninfo.md) > [executablePath](./puppeteer.browserfetcherrevisioninfo.executablepath.md) + +## BrowserFetcherRevisionInfo.executablePath property + +Signature: + +```typescript +executablePath: string; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.browserfetcherrevisioninfo.folderpath.md b/website/versioned_docs/version-10.0.0/puppeteer.browserfetcherrevisioninfo.folderpath.md new file mode 100644 index 00000000000..bc31e043e38 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.browserfetcherrevisioninfo.folderpath.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserFetcherRevisionInfo](./puppeteer.browserfetcherrevisioninfo.md) > [folderPath](./puppeteer.browserfetcherrevisioninfo.folderpath.md) + +## BrowserFetcherRevisionInfo.folderPath property + +Signature: + +```typescript +folderPath: string; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.browserfetcherrevisioninfo.local.md b/website/versioned_docs/version-10.0.0/puppeteer.browserfetcherrevisioninfo.local.md new file mode 100644 index 00000000000..f35fc717412 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.browserfetcherrevisioninfo.local.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserFetcherRevisionInfo](./puppeteer.browserfetcherrevisioninfo.md) > [local](./puppeteer.browserfetcherrevisioninfo.local.md) + +## BrowserFetcherRevisionInfo.local property + +Signature: + +```typescript +local: boolean; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.browserfetcherrevisioninfo.md b/website/versioned_docs/version-10.0.0/puppeteer.browserfetcherrevisioninfo.md new file mode 100644 index 00000000000..e7dabf4dc05 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.browserfetcherrevisioninfo.md @@ -0,0 +1,24 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserFetcherRevisionInfo](./puppeteer.browserfetcherrevisioninfo.md) + +## BrowserFetcherRevisionInfo interface + + +Signature: + +```typescript +export interface BrowserFetcherRevisionInfo +``` + +## Properties + +| Property | 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-10.0.0/puppeteer.browserfetcherrevisioninfo.product.md b/website/versioned_docs/version-10.0.0/puppeteer.browserfetcherrevisioninfo.product.md new file mode 100644 index 00000000000..99bdca573e0 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.browserfetcherrevisioninfo.product.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserFetcherRevisionInfo](./puppeteer.browserfetcherrevisioninfo.md) > [product](./puppeteer.browserfetcherrevisioninfo.product.md) + +## BrowserFetcherRevisionInfo.product property + +Signature: + +```typescript +product: string; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.browserfetcherrevisioninfo.revision.md b/website/versioned_docs/version-10.0.0/puppeteer.browserfetcherrevisioninfo.revision.md new file mode 100644 index 00000000000..e084a3327e3 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.browserfetcherrevisioninfo.revision.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserFetcherRevisionInfo](./puppeteer.browserfetcherrevisioninfo.md) > [revision](./puppeteer.browserfetcherrevisioninfo.revision.md) + +## BrowserFetcherRevisionInfo.revision property + +Signature: + +```typescript +revision: string; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.browserfetcherrevisioninfo.url.md b/website/versioned_docs/version-10.0.0/puppeteer.browserfetcherrevisioninfo.url.md new file mode 100644 index 00000000000..eee943e9897 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.browserfetcherrevisioninfo.url.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserFetcherRevisionInfo](./puppeteer.browserfetcherrevisioninfo.md) > [url](./puppeteer.browserfetcherrevisioninfo.url.md) + +## BrowserFetcherRevisionInfo.url property + +Signature: + +```typescript +url: string; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.browserlaunchargumentoptions.args.md b/website/versioned_docs/version-10.0.0/puppeteer.browserlaunchargumentoptions.args.md new file mode 100644 index 00000000000..7fcc88938af --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.browserlaunchargumentoptions.args.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserLaunchArgumentOptions](./puppeteer.browserlaunchargumentoptions.md) > [args](./puppeteer.browserlaunchargumentoptions.args.md) + +## BrowserLaunchArgumentOptions.args property + +Additional command line arguments to pass to the browser instance. + +Signature: + +```typescript +args?: string[]; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.browserlaunchargumentoptions.devtools.md b/website/versioned_docs/version-10.0.0/puppeteer.browserlaunchargumentoptions.devtools.md new file mode 100644 index 00000000000..0bc2fbf8018 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.browserlaunchargumentoptions.devtools.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserLaunchArgumentOptions](./puppeteer.browserlaunchargumentoptions.md) > [devtools](./puppeteer.browserlaunchargumentoptions.devtools.md) + +## BrowserLaunchArgumentOptions.devtools property + +Whether to auto-open a DevTools panel for each tab. If this is set to `true`, then `headless` will be set to `false` automatically. + +Signature: + +```typescript +devtools?: boolean; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.browserlaunchargumentoptions.headless.md b/website/versioned_docs/version-10.0.0/puppeteer.browserlaunchargumentoptions.headless.md new file mode 100644 index 00000000000..cc881e3ce10 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.browserlaunchargumentoptions.headless.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserLaunchArgumentOptions](./puppeteer.browserlaunchargumentoptions.md) > [headless](./puppeteer.browserlaunchargumentoptions.headless.md) + +## BrowserLaunchArgumentOptions.headless property + +Whether to run the browser in headless mode. + +Signature: + +```typescript +headless?: boolean; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.browserlaunchargumentoptions.md b/website/versioned_docs/version-10.0.0/puppeteer.browserlaunchargumentoptions.md new file mode 100644 index 00000000000..ec48b01c55c --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.browserlaunchargumentoptions.md @@ -0,0 +1,23 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserLaunchArgumentOptions](./puppeteer.browserlaunchargumentoptions.md) + +## BrowserLaunchArgumentOptions interface + +Launcher options that only apply to Chrome. + +Signature: + +```typescript +export interface BrowserLaunchArgumentOptions +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [args?](./puppeteer.browserlaunchargumentoptions.args.md) | string\[\] | (Optional) Additional command line arguments to pass to the browser instance. | +| [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 set to false automatically. | +| [headless?](./puppeteer.browserlaunchargumentoptions.headless.md) | boolean | (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/+/master/docs/user_data_dir.md) for more info. | + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.browserlaunchargumentoptions.userdatadir.md b/website/versioned_docs/version-10.0.0/puppeteer.browserlaunchargumentoptions.userdatadir.md new file mode 100644 index 00000000000..03badd8a30a --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.browserlaunchargumentoptions.userdatadir.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserLaunchArgumentOptions](./puppeteer.browserlaunchargumentoptions.md) > [userDataDir](./puppeteer.browserlaunchargumentoptions.userdatadir.md) + +## BrowserLaunchArgumentOptions.userDataDir property + +Path to a user data directory. [see the Chromium docs](https://chromium.googlesource.com/chromium/src/+/master/docs/user_data_dir.md) for more info. + +Signature: + +```typescript +userDataDir?: string; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.cdpsession.connection.md b/website/versioned_docs/version-10.0.0/puppeteer.cdpsession.connection.md new file mode 100644 index 00000000000..e4ca749950a --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.cdpsession.connection.md @@ -0,0 +1,15 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [CDPSession](./puppeteer.cdpsession.md) > [connection](./puppeteer.cdpsession.connection.md) + +## CDPSession.connection() method + +Signature: + +```typescript +connection(): Connection; +``` +Returns: + +[Connection](./puppeteer.connection.md) + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.cdpsession.detach.md b/website/versioned_docs/version-10.0.0/puppeteer.cdpsession.detach.md new file mode 100644 index 00000000000..b90f2c6210b --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.cdpsession.detach.md @@ -0,0 +1,17 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [CDPSession](./puppeteer.cdpsession.md) > [detach](./puppeteer.cdpsession.detach.md) + +## 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 +detach(): Promise; +``` +Returns: + +Promise<void> + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.cdpsession.md b/website/versioned_docs/version-10.0.0/puppeteer.cdpsession.md new file mode 100644 index 00000000000..4bac2335af9 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.cdpsession.md @@ -0,0 +1,46 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [CDPSession](./puppeteer.cdpsession.md) + +## 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/master/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 + + +```js +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. | +| [send(method, paramArgs)](./puppeteer.cdpsession.send.md) | | | + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.cdpsession.send.md b/website/versioned_docs/version-10.0.0/puppeteer.cdpsession.send.md new file mode 100644 index 00000000000..317d01c9993 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.cdpsession.send.md @@ -0,0 +1,23 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [CDPSession](./puppeteer.cdpsession.md) > [send](./puppeteer.cdpsession.send.md) + +## CDPSession.send() method + +Signature: + +```typescript +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-10.0.0/puppeteer.cdpsessiononmessageobject.error.md b/website/versioned_docs/version-10.0.0/puppeteer.cdpsessiononmessageobject.error.md new file mode 100644 index 00000000000..d4583855267 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.cdpsessiononmessageobject.error.md @@ -0,0 +1,14 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [CDPSessionOnMessageObject](./puppeteer.cdpsessiononmessageobject.md) > [error](./puppeteer.cdpsessiononmessageobject.error.md) + +## CDPSessionOnMessageObject.error property + +Signature: + +```typescript +error: { + message: string; + data: any; + }; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.cdpsessiononmessageobject.id.md b/website/versioned_docs/version-10.0.0/puppeteer.cdpsessiononmessageobject.id.md new file mode 100644 index 00000000000..3e8d0a561e2 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.cdpsessiononmessageobject.id.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [CDPSessionOnMessageObject](./puppeteer.cdpsessiononmessageobject.md) > [id](./puppeteer.cdpsessiononmessageobject.id.md) + +## CDPSessionOnMessageObject.id property + +Signature: + +```typescript +id?: number; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.cdpsessiononmessageobject.md b/website/versioned_docs/version-10.0.0/puppeteer.cdpsessiononmessageobject.md new file mode 100644 index 00000000000..d7354b82490 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.cdpsessiononmessageobject.md @@ -0,0 +1,23 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [CDPSessionOnMessageObject](./puppeteer.cdpsessiononmessageobject.md) + +## CDPSessionOnMessageObject interface + + +Signature: + +```typescript +export interface CDPSessionOnMessageObject +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [error](./puppeteer.cdpsessiononmessageobject.error.md) | { message: string; data: any; } | | +| [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-10.0.0/puppeteer.cdpsessiononmessageobject.method.md b/website/versioned_docs/version-10.0.0/puppeteer.cdpsessiononmessageobject.method.md new file mode 100644 index 00000000000..c5217865b56 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.cdpsessiononmessageobject.method.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [CDPSessionOnMessageObject](./puppeteer.cdpsessiononmessageobject.md) > [method](./puppeteer.cdpsessiononmessageobject.method.md) + +## CDPSessionOnMessageObject.method property + +Signature: + +```typescript +method: string; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.cdpsessiononmessageobject.params.md b/website/versioned_docs/version-10.0.0/puppeteer.cdpsessiononmessageobject.params.md new file mode 100644 index 00000000000..df6d129a94e --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.cdpsessiononmessageobject.params.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [CDPSessionOnMessageObject](./puppeteer.cdpsessiononmessageobject.md) > [params](./puppeteer.cdpsessiononmessageobject.params.md) + +## CDPSessionOnMessageObject.params property + +Signature: + +```typescript +params: Record; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.cdpsessiononmessageobject.result.md b/website/versioned_docs/version-10.0.0/puppeteer.cdpsessiononmessageobject.result.md new file mode 100644 index 00000000000..c53f7343739 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.cdpsessiononmessageobject.result.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [CDPSessionOnMessageObject](./puppeteer.cdpsessiononmessageobject.md) > [result](./puppeteer.cdpsessiononmessageobject.result.md) + +## CDPSessionOnMessageObject.result property + +Signature: + +```typescript +result?: any; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.chromereleasechannel.md b/website/versioned_docs/version-10.0.0/puppeteer.chromereleasechannel.md new file mode 100644 index 00000000000..c4496235bb4 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.chromereleasechannel.md @@ -0,0 +1,12 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ChromeReleaseChannel](./puppeteer.chromereleasechannel.md) + +## ChromeReleaseChannel type + + +Signature: + +```typescript +export declare type ChromeReleaseChannel = 'chrome' | 'chrome-beta' | 'chrome-canary' | 'chrome-dev'; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.clearcustomqueryhandlers.md b/website/versioned_docs/version-10.0.0/puppeteer.clearcustomqueryhandlers.md new file mode 100644 index 00000000000..f6bb8422e4d --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.clearcustomqueryhandlers.md @@ -0,0 +1,17 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [clearCustomQueryHandlers](./puppeteer.clearcustomqueryhandlers.md) + +## clearCustomQueryHandlers() function + +Clears all registered handlers. + +Signature: + +```typescript +export declare function clearCustomQueryHandlers(): void; +``` +Returns: + +void + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.clickoptions.button.md b/website/versioned_docs/version-10.0.0/puppeteer.clickoptions.button.md new file mode 100644 index 00000000000..2b9d0629954 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.clickoptions.button.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ClickOptions](./puppeteer.clickoptions.md) > [button](./puppeteer.clickoptions.button.md) + +## ClickOptions.button property + +Signature: + +```typescript +button?: 'left' | 'right' | 'middle'; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.clickoptions.clickcount.md b/website/versioned_docs/version-10.0.0/puppeteer.clickoptions.clickcount.md new file mode 100644 index 00000000000..942570833d4 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.clickoptions.clickcount.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ClickOptions](./puppeteer.clickoptions.md) > [clickCount](./puppeteer.clickoptions.clickcount.md) + +## ClickOptions.clickCount property + +Signature: + +```typescript +clickCount?: number; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.clickoptions.delay.md b/website/versioned_docs/version-10.0.0/puppeteer.clickoptions.delay.md new file mode 100644 index 00000000000..c96b46a1a09 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.clickoptions.delay.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ClickOptions](./puppeteer.clickoptions.md) > [delay](./puppeteer.clickoptions.delay.md) + +## ClickOptions.delay property + +Time to wait between `mousedown` and `mouseup` in milliseconds. + +Signature: + +```typescript +delay?: number; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.clickoptions.md b/website/versioned_docs/version-10.0.0/puppeteer.clickoptions.md new file mode 100644 index 00000000000..2ed03e2f64f --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.clickoptions.md @@ -0,0 +1,21 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ClickOptions](./puppeteer.clickoptions.md) + +## ClickOptions interface + + +Signature: + +```typescript +export interface ClickOptions +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [button?](./puppeteer.clickoptions.button.md) | 'left' \| 'right' \| 'middle' | (Optional) | +| [clickCount?](./puppeteer.clickoptions.clickcount.md) | number | (Optional) | +| [delay?](./puppeteer.clickoptions.delay.md) | number | (Optional) Time to wait between mousedown and mouseup in milliseconds. | + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.commoneventemitter.addlistener.md b/website/versioned_docs/version-10.0.0/puppeteer.commoneventemitter.addlistener.md new file mode 100644 index 00000000000..60f0fe3d26b --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.commoneventemitter.addlistener.md @@ -0,0 +1,23 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [CommonEventEmitter](./puppeteer.commoneventemitter.md) > [addListener](./puppeteer.commoneventemitter.addlistener.md) + +## CommonEventEmitter.addListener() method + +Signature: + +```typescript +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-10.0.0/puppeteer.commoneventemitter.emit.md b/website/versioned_docs/version-10.0.0/puppeteer.commoneventemitter.emit.md new file mode 100644 index 00000000000..75e72f375d9 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.commoneventemitter.emit.md @@ -0,0 +1,23 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [CommonEventEmitter](./puppeteer.commoneventemitter.md) > [emit](./puppeteer.commoneventemitter.emit.md) + +## CommonEventEmitter.emit() method + +Signature: + +```typescript +emit(event: EventType, eventData?: unknown): boolean; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| event | [EventType](./puppeteer.eventtype.md) | | +| eventData | unknown | | + +Returns: + +boolean + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.commoneventemitter.listenercount.md b/website/versioned_docs/version-10.0.0/puppeteer.commoneventemitter.listenercount.md new file mode 100644 index 00000000000..2e68d936cdc --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.commoneventemitter.listenercount.md @@ -0,0 +1,22 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [CommonEventEmitter](./puppeteer.commoneventemitter.md) > [listenerCount](./puppeteer.commoneventemitter.listenercount.md) + +## CommonEventEmitter.listenerCount() method + +Signature: + +```typescript +listenerCount(event: string): number; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| event | string | | + +Returns: + +number + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.commoneventemitter.md b/website/versioned_docs/version-10.0.0/puppeteer.commoneventemitter.md new file mode 100644 index 00000000000..1ec59b257ad --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.commoneventemitter.md @@ -0,0 +1,26 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [CommonEventEmitter](./puppeteer.commoneventemitter.md) + +## 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-10.0.0/puppeteer.commoneventemitter.off.md b/website/versioned_docs/version-10.0.0/puppeteer.commoneventemitter.off.md new file mode 100644 index 00000000000..bf8f9437ccc --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.commoneventemitter.off.md @@ -0,0 +1,23 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [CommonEventEmitter](./puppeteer.commoneventemitter.md) > [off](./puppeteer.commoneventemitter.off.md) + +## CommonEventEmitter.off() method + +Signature: + +```typescript +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-10.0.0/puppeteer.commoneventemitter.on.md b/website/versioned_docs/version-10.0.0/puppeteer.commoneventemitter.on.md new file mode 100644 index 00000000000..15193a28cf0 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.commoneventemitter.on.md @@ -0,0 +1,23 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [CommonEventEmitter](./puppeteer.commoneventemitter.md) > [on](./puppeteer.commoneventemitter.on.md) + +## CommonEventEmitter.on() method + +Signature: + +```typescript +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-10.0.0/puppeteer.commoneventemitter.once.md b/website/versioned_docs/version-10.0.0/puppeteer.commoneventemitter.once.md new file mode 100644 index 00000000000..9066bd6aa90 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.commoneventemitter.once.md @@ -0,0 +1,23 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [CommonEventEmitter](./puppeteer.commoneventemitter.md) > [once](./puppeteer.commoneventemitter.once.md) + +## CommonEventEmitter.once() method + +Signature: + +```typescript +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-10.0.0/puppeteer.commoneventemitter.removealllisteners.md b/website/versioned_docs/version-10.0.0/puppeteer.commoneventemitter.removealllisteners.md new file mode 100644 index 00000000000..a52938a09e4 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.commoneventemitter.removealllisteners.md @@ -0,0 +1,22 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [CommonEventEmitter](./puppeteer.commoneventemitter.md) > [removeAllListeners](./puppeteer.commoneventemitter.removealllisteners.md) + +## CommonEventEmitter.removeAllListeners() method + +Signature: + +```typescript +removeAllListeners(event?: EventType): CommonEventEmitter; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| event | [EventType](./puppeteer.eventtype.md) | | + +Returns: + +[CommonEventEmitter](./puppeteer.commoneventemitter.md) + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.commoneventemitter.removelistener.md b/website/versioned_docs/version-10.0.0/puppeteer.commoneventemitter.removelistener.md new file mode 100644 index 00000000000..9053478c28f --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.commoneventemitter.removelistener.md @@ -0,0 +1,23 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [CommonEventEmitter](./puppeteer.commoneventemitter.md) > [removeListener](./puppeteer.commoneventemitter.removelistener.md) + +## CommonEventEmitter.removeListener() method + +Signature: + +```typescript +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-10.0.0/puppeteer.connect.md b/website/versioned_docs/version-10.0.0/puppeteer.connect.md new file mode 100644 index 00000000000..57b13bca920 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.connect.md @@ -0,0 +1,29 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [connect](./puppeteer.connect.md) + +## connect() function + +This method attaches Puppeteer to an existing browser instance. + +Signature: + +```typescript +export declare function connect(options: ConnectOptions): Promise; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| options | [ConnectOptions](./puppeteer.connectoptions.md) | Set of configurable options to set on the browser. | + +Returns: + +Promise<[Browser](./puppeteer.browser.md)> + +Promise which resolves to browser instance. + +## Remarks + + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.connection._callbacks.md b/website/versioned_docs/version-10.0.0/puppeteer.connection._callbacks.md new file mode 100644 index 00000000000..69922d9e55b --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.connection._callbacks.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Connection](./puppeteer.connection.md) > [\_callbacks](./puppeteer.connection._callbacks.md) + +## Connection.\_callbacks property + +Signature: + +```typescript +_callbacks: Map; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.connection._closed.md b/website/versioned_docs/version-10.0.0/puppeteer.connection._closed.md new file mode 100644 index 00000000000..7c5aa0625ff --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.connection._closed.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Connection](./puppeteer.connection.md) > [\_closed](./puppeteer.connection._closed.md) + +## Connection.\_closed property + +Signature: + +```typescript +_closed: boolean; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.connection._constructor_.md b/website/versioned_docs/version-10.0.0/puppeteer.connection._constructor_.md new file mode 100644 index 00000000000..b5539c1239d --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.connection._constructor_.md @@ -0,0 +1,22 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Connection](./puppeteer.connection.md) > [(constructor)](./puppeteer.connection._constructor_.md) + +## Connection.(constructor) + +Constructs a new instance of the `Connection` class + +Signature: + +```typescript +constructor(url: string, transport: ConnectionTransport, delay?: number); +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| url | string | | +| transport | [ConnectionTransport](./puppeteer.connectiontransport.md) | | +| delay | number | | + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.connection._delay.md b/website/versioned_docs/version-10.0.0/puppeteer.connection._delay.md new file mode 100644 index 00000000000..14839d62082 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.connection._delay.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Connection](./puppeteer.connection.md) > [\_delay](./puppeteer.connection._delay.md) + +## Connection.\_delay property + +Signature: + +```typescript +_delay: number; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.connection._lastid.md b/website/versioned_docs/version-10.0.0/puppeteer.connection._lastid.md new file mode 100644 index 00000000000..66c8641b67b --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.connection._lastid.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Connection](./puppeteer.connection.md) > [\_lastId](./puppeteer.connection._lastid.md) + +## Connection.\_lastId property + +Signature: + +```typescript +_lastId: number; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.connection._onclose.md b/website/versioned_docs/version-10.0.0/puppeteer.connection._onclose.md new file mode 100644 index 00000000000..31d6153ec28 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.connection._onclose.md @@ -0,0 +1,15 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Connection](./puppeteer.connection.md) > [\_onClose](./puppeteer.connection._onclose.md) + +## Connection.\_onClose() method + +Signature: + +```typescript +_onClose(): void; +``` +Returns: + +void + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.connection._onmessage.md b/website/versioned_docs/version-10.0.0/puppeteer.connection._onmessage.md new file mode 100644 index 00000000000..7dca08b4da3 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.connection._onmessage.md @@ -0,0 +1,22 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Connection](./puppeteer.connection.md) > [\_onMessage](./puppeteer.connection._onmessage.md) + +## Connection.\_onMessage() method + +Signature: + +```typescript +_onMessage(message: string): Promise; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| message | string | | + +Returns: + +Promise<void> + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.connection._rawsend.md b/website/versioned_docs/version-10.0.0/puppeteer.connection._rawsend.md new file mode 100644 index 00000000000..6a83d3104b9 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.connection._rawsend.md @@ -0,0 +1,22 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Connection](./puppeteer.connection.md) > [\_rawSend](./puppeteer.connection._rawsend.md) + +## Connection.\_rawSend() method + +Signature: + +```typescript +_rawSend(message: Record): number; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| message | Record<string, unknown> | | + +Returns: + +number + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.connection._sessions.md b/website/versioned_docs/version-10.0.0/puppeteer.connection._sessions.md new file mode 100644 index 00000000000..de2d752218d --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.connection._sessions.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Connection](./puppeteer.connection.md) > [\_sessions](./puppeteer.connection._sessions.md) + +## Connection.\_sessions property + +Signature: + +```typescript +_sessions: Map; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.connection._transport.md b/website/versioned_docs/version-10.0.0/puppeteer.connection._transport.md new file mode 100644 index 00000000000..c8692e633ea --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.connection._transport.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Connection](./puppeteer.connection.md) > [\_transport](./puppeteer.connection._transport.md) + +## Connection.\_transport property + +Signature: + +```typescript +_transport: ConnectionTransport; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.connection._url.md b/website/versioned_docs/version-10.0.0/puppeteer.connection._url.md new file mode 100644 index 00000000000..fc5bce58062 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.connection._url.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Connection](./puppeteer.connection.md) > [\_url](./puppeteer.connection._url.md) + +## Connection.\_url property + +Signature: + +```typescript +_url: string; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.connection.createsession.md b/website/versioned_docs/version-10.0.0/puppeteer.connection.createsession.md new file mode 100644 index 00000000000..19ccedbe794 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.connection.createsession.md @@ -0,0 +1,24 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Connection](./puppeteer.connection.md) > [createSession](./puppeteer.connection.createsession.md) + +## Connection.createSession() method + +Signature: + +```typescript +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-10.0.0/puppeteer.connection.dispose.md b/website/versioned_docs/version-10.0.0/puppeteer.connection.dispose.md new file mode 100644 index 00000000000..07d8e9b585a --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.connection.dispose.md @@ -0,0 +1,15 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Connection](./puppeteer.connection.md) > [dispose](./puppeteer.connection.dispose.md) + +## Connection.dispose() method + +Signature: + +```typescript +dispose(): void; +``` +Returns: + +void + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.connection.fromsession.md b/website/versioned_docs/version-10.0.0/puppeteer.connection.fromsession.md new file mode 100644 index 00000000000..8663934a5fd --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.connection.fromsession.md @@ -0,0 +1,22 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Connection](./puppeteer.connection.md) > [fromSession](./puppeteer.connection.fromsession.md) + +## Connection.fromSession() method + +Signature: + +```typescript +static fromSession(session: CDPSession): Connection; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| session | [CDPSession](./puppeteer.cdpsession.md) | | + +Returns: + +[Connection](./puppeteer.connection.md) + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.connection.md b/website/versioned_docs/version-10.0.0/puppeteer.connection.md new file mode 100644 index 00000000000..385faea9236 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.connection.md @@ -0,0 +1,46 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Connection](./puppeteer.connection.md) + +## 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 | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [\_callbacks](./puppeteer.connection._callbacks.md) | | Map<number, [ConnectionCallback](./puppeteer.connectioncallback.md)> | | +| [\_closed](./puppeteer.connection._closed.md) | | boolean | | +| [\_delay](./puppeteer.connection._delay.md) | | number | | +| [\_lastId](./puppeteer.connection._lastid.md) | | number | | +| [\_sessions](./puppeteer.connection._sessions.md) | | Map<string, [CDPSession](./puppeteer.cdpsession.md)> | | +| [\_transport](./puppeteer.connection._transport.md) | | [ConnectionTransport](./puppeteer.connectiontransport.md) | | +| [\_url](./puppeteer.connection._url.md) | | string | | + +## Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [\_onClose()](./puppeteer.connection._onclose.md) | | | +| [\_onMessage(message)](./puppeteer.connection._onmessage.md) | | | +| [\_rawSend(message)](./puppeteer.connection._rawsend.md) | | | +| [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-10.0.0/puppeteer.connection.send.md b/website/versioned_docs/version-10.0.0/puppeteer.connection.send.md new file mode 100644 index 00000000000..b5c4185416e --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.connection.send.md @@ -0,0 +1,23 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Connection](./puppeteer.connection.md) > [send](./puppeteer.connection.send.md) + +## Connection.send() method + +Signature: + +```typescript +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-10.0.0/puppeteer.connection.session.md b/website/versioned_docs/version-10.0.0/puppeteer.connection.session.md new file mode 100644 index 00000000000..901679b7aab --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.connection.session.md @@ -0,0 +1,24 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Connection](./puppeteer.connection.md) > [session](./puppeteer.connection.session.md) + +## Connection.session() method + +Signature: + +```typescript +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-10.0.0/puppeteer.connection.url.md b/website/versioned_docs/version-10.0.0/puppeteer.connection.url.md new file mode 100644 index 00000000000..90bd6c6155a --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.connection.url.md @@ -0,0 +1,15 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Connection](./puppeteer.connection.md) > [url](./puppeteer.connection.url.md) + +## Connection.url() method + +Signature: + +```typescript +url(): string; +``` +Returns: + +string + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.connectioncallback.error.md b/website/versioned_docs/version-10.0.0/puppeteer.connectioncallback.error.md new file mode 100644 index 00000000000..e5488d211fc --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.connectioncallback.error.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ConnectionCallback](./puppeteer.connectioncallback.md) > [error](./puppeteer.connectioncallback.error.md) + +## ConnectionCallback.error property + +Signature: + +```typescript +error: Error; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.connectioncallback.md b/website/versioned_docs/version-10.0.0/puppeteer.connectioncallback.md new file mode 100644 index 00000000000..ca512049445 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.connectioncallback.md @@ -0,0 +1,22 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ConnectionCallback](./puppeteer.connectioncallback.md) + +## ConnectionCallback interface + + +Signature: + +```typescript +export interface ConnectionCallback +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [error](./puppeteer.connectioncallback.error.md) | Error | | +| [method](./puppeteer.connectioncallback.method.md) | string | | +| [reject](./puppeteer.connectioncallback.reject.md) | Function | | +| [resolve](./puppeteer.connectioncallback.resolve.md) | Function | | + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.connectioncallback.method.md b/website/versioned_docs/version-10.0.0/puppeteer.connectioncallback.method.md new file mode 100644 index 00000000000..1cb9db85245 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.connectioncallback.method.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ConnectionCallback](./puppeteer.connectioncallback.md) > [method](./puppeteer.connectioncallback.method.md) + +## ConnectionCallback.method property + +Signature: + +```typescript +method: string; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.connectioncallback.reject.md b/website/versioned_docs/version-10.0.0/puppeteer.connectioncallback.reject.md new file mode 100644 index 00000000000..2810ebcbe28 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.connectioncallback.reject.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ConnectionCallback](./puppeteer.connectioncallback.md) > [reject](./puppeteer.connectioncallback.reject.md) + +## ConnectionCallback.reject property + +Signature: + +```typescript +reject: Function; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.connectioncallback.resolve.md b/website/versioned_docs/version-10.0.0/puppeteer.connectioncallback.resolve.md new file mode 100644 index 00000000000..41dd33698e9 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.connectioncallback.resolve.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ConnectionCallback](./puppeteer.connectioncallback.md) > [resolve](./puppeteer.connectioncallback.resolve.md) + +## ConnectionCallback.resolve property + +Signature: + +```typescript +resolve: Function; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.connectiontransport.close.md b/website/versioned_docs/version-10.0.0/puppeteer.connectiontransport.close.md new file mode 100644 index 00000000000..8985544adf2 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.connectiontransport.close.md @@ -0,0 +1,15 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ConnectionTransport](./puppeteer.connectiontransport.md) > [close](./puppeteer.connectiontransport.close.md) + +## ConnectionTransport.close() method + +Signature: + +```typescript +close(): any; +``` +Returns: + +any + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.connectiontransport.md b/website/versioned_docs/version-10.0.0/puppeteer.connectiontransport.md new file mode 100644 index 00000000000..9c918538ce6 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.connectiontransport.md @@ -0,0 +1,27 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ConnectionTransport](./puppeteer.connectiontransport.md) + +## ConnectionTransport interface + + +Signature: + +```typescript +export interface ConnectionTransport +``` + +## Properties + +| Property | 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(string)](./puppeteer.connectiontransport.send.md) | | + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.connectiontransport.onclose.md b/website/versioned_docs/version-10.0.0/puppeteer.connectiontransport.onclose.md new file mode 100644 index 00000000000..7c87797c4ca --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.connectiontransport.onclose.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ConnectionTransport](./puppeteer.connectiontransport.md) > [onclose](./puppeteer.connectiontransport.onclose.md) + +## ConnectionTransport.onclose property + +Signature: + +```typescript +onclose?: () => void; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.connectiontransport.onmessage.md b/website/versioned_docs/version-10.0.0/puppeteer.connectiontransport.onmessage.md new file mode 100644 index 00000000000..7af1a876c77 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.connectiontransport.onmessage.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ConnectionTransport](./puppeteer.connectiontransport.md) > [onmessage](./puppeteer.connectiontransport.onmessage.md) + +## ConnectionTransport.onmessage property + +Signature: + +```typescript +onmessage?: (message: string) => void; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.connectiontransport.send.md b/website/versioned_docs/version-10.0.0/puppeteer.connectiontransport.send.md new file mode 100644 index 00000000000..0a87f13a8c9 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.connectiontransport.send.md @@ -0,0 +1,22 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ConnectionTransport](./puppeteer.connectiontransport.md) > [send](./puppeteer.connectiontransport.send.md) + +## ConnectionTransport.send() method + +Signature: + +```typescript +send(string: any): any; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| string | any | | + +Returns: + +any + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.connectoptions.browserurl.md b/website/versioned_docs/version-10.0.0/puppeteer.connectoptions.browserurl.md new file mode 100644 index 00000000000..987e5214302 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.connectoptions.browserurl.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ConnectOptions](./puppeteer.connectoptions.md) > [browserURL](./puppeteer.connectoptions.browserurl.md) + +## ConnectOptions.browserURL property + +Signature: + +```typescript +browserURL?: string; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.connectoptions.browserwsendpoint.md b/website/versioned_docs/version-10.0.0/puppeteer.connectoptions.browserwsendpoint.md new file mode 100644 index 00000000000..2b79ea3c5b7 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.connectoptions.browserwsendpoint.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ConnectOptions](./puppeteer.connectoptions.md) > [browserWSEndpoint](./puppeteer.connectoptions.browserwsendpoint.md) + +## ConnectOptions.browserWSEndpoint property + +Signature: + +```typescript +browserWSEndpoint?: string; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.connectoptions.md b/website/versioned_docs/version-10.0.0/puppeteer.connectoptions.md new file mode 100644 index 00000000000..4c465dda01b --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.connectoptions.md @@ -0,0 +1,23 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ConnectOptions](./puppeteer.connectoptions.md) + +## ConnectOptions interface + + +Signature: + +```typescript +export interface ConnectOptions extends BrowserConnectOptions +``` +Extends: [BrowserConnectOptions](./puppeteer.browserconnectoptions.md) + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [browserURL?](./puppeteer.connectoptions.browserurl.md) | string | (Optional) | +| [browserWSEndpoint?](./puppeteer.connectoptions.browserwsendpoint.md) | string | (Optional) | +| [product?](./puppeteer.connectoptions.product.md) | [Product](./puppeteer.product.md) | (Optional) | +| [transport?](./puppeteer.connectoptions.transport.md) | [ConnectionTransport](./puppeteer.connectiontransport.md) | (Optional) | + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.connectoptions.product.md b/website/versioned_docs/version-10.0.0/puppeteer.connectoptions.product.md new file mode 100644 index 00000000000..b828ce7ba05 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.connectoptions.product.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ConnectOptions](./puppeteer.connectoptions.md) > [product](./puppeteer.connectoptions.product.md) + +## ConnectOptions.product property + +Signature: + +```typescript +product?: Product; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.connectoptions.transport.md b/website/versioned_docs/version-10.0.0/puppeteer.connectoptions.transport.md new file mode 100644 index 00000000000..50a40a1e148 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.connectoptions.transport.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ConnectOptions](./puppeteer.connectoptions.md) > [transport](./puppeteer.connectoptions.transport.md) + +## ConnectOptions.transport property + +Signature: + +```typescript +transport?: ConnectionTransport; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.consolemessage._constructor_.md b/website/versioned_docs/version-10.0.0/puppeteer.consolemessage._constructor_.md new file mode 100644 index 00000000000..11614f1bac1 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.consolemessage._constructor_.md @@ -0,0 +1,23 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ConsoleMessage](./puppeteer.consolemessage.md) > [(constructor)](./puppeteer.consolemessage._constructor_.md) + +## ConsoleMessage.(constructor) + +Constructs a new instance of the `ConsoleMessage` class + +Signature: + +```typescript +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-10.0.0/puppeteer.consolemessage.args.md b/website/versioned_docs/version-10.0.0/puppeteer.consolemessage.args.md new file mode 100644 index 00000000000..a346e18d4f2 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.consolemessage.args.md @@ -0,0 +1,17 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ConsoleMessage](./puppeteer.consolemessage.md) > [args](./puppeteer.consolemessage.args.md) + +## ConsoleMessage.args() method + +Signature: + +```typescript +args(): JSHandle[]; +``` +Returns: + +[JSHandle](./puppeteer.jshandle.md)\[\] + +An array of arguments passed to the console. + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.consolemessage.location.md b/website/versioned_docs/version-10.0.0/puppeteer.consolemessage.location.md new file mode 100644 index 00000000000..1eac0154d58 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.consolemessage.location.md @@ -0,0 +1,17 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ConsoleMessage](./puppeteer.consolemessage.md) > [location](./puppeteer.consolemessage.location.md) + +## ConsoleMessage.location() method + +Signature: + +```typescript +location(): ConsoleMessageLocation; +``` +Returns: + +[ConsoleMessageLocation](./puppeteer.consolemessagelocation.md) + +The location of the console message. + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.consolemessage.md b/website/versioned_docs/version-10.0.0/puppeteer.consolemessage.md new file mode 100644 index 00000000000..e56e5bd2093 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.consolemessage.md @@ -0,0 +1,30 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ConsoleMessage](./puppeteer.consolemessage.md) + +## 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-10.0.0/puppeteer.consolemessage.stacktrace.md b/website/versioned_docs/version-10.0.0/puppeteer.consolemessage.stacktrace.md new file mode 100644 index 00000000000..b326e6c7bb6 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.consolemessage.stacktrace.md @@ -0,0 +1,17 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ConsoleMessage](./puppeteer.consolemessage.md) > [stackTrace](./puppeteer.consolemessage.stacktrace.md) + +## ConsoleMessage.stackTrace() method + +Signature: + +```typescript +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-10.0.0/puppeteer.consolemessage.text.md b/website/versioned_docs/version-10.0.0/puppeteer.consolemessage.text.md new file mode 100644 index 00000000000..6b4edb5ca63 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.consolemessage.text.md @@ -0,0 +1,17 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ConsoleMessage](./puppeteer.consolemessage.md) > [text](./puppeteer.consolemessage.text.md) + +## ConsoleMessage.text() method + +Signature: + +```typescript +text(): string; +``` +Returns: + +string + +The text of the console message. + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.consolemessage.type.md b/website/versioned_docs/version-10.0.0/puppeteer.consolemessage.type.md new file mode 100644 index 00000000000..685b61957c7 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.consolemessage.type.md @@ -0,0 +1,17 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ConsoleMessage](./puppeteer.consolemessage.md) > [type](./puppeteer.consolemessage.type.md) + +## ConsoleMessage.type() method + +Signature: + +```typescript +type(): ConsoleMessageType; +``` +Returns: + +[ConsoleMessageType](./puppeteer.consolemessagetype.md) + +The type of the console message. + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.consolemessagelocation.columnnumber.md b/website/versioned_docs/version-10.0.0/puppeteer.consolemessagelocation.columnnumber.md new file mode 100644 index 00000000000..23a6b3d20a0 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.consolemessagelocation.columnnumber.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ConsoleMessageLocation](./puppeteer.consolemessagelocation.md) > [columnNumber](./puppeteer.consolemessagelocation.columnnumber.md) + +## ConsoleMessageLocation.columnNumber property + +0-based column number in the resource if known or `undefined` otherwise. + +Signature: + +```typescript +columnNumber?: number; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.consolemessagelocation.linenumber.md b/website/versioned_docs/version-10.0.0/puppeteer.consolemessagelocation.linenumber.md new file mode 100644 index 00000000000..cdc1fd45792 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.consolemessagelocation.linenumber.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ConsoleMessageLocation](./puppeteer.consolemessagelocation.md) > [lineNumber](./puppeteer.consolemessagelocation.linenumber.md) + +## ConsoleMessageLocation.lineNumber property + +0-based line number in the resource if known or `undefined` otherwise. + +Signature: + +```typescript +lineNumber?: number; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.consolemessagelocation.md b/website/versioned_docs/version-10.0.0/puppeteer.consolemessagelocation.md new file mode 100644 index 00000000000..b6f032160a6 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.consolemessagelocation.md @@ -0,0 +1,21 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ConsoleMessageLocation](./puppeteer.consolemessagelocation.md) + +## ConsoleMessageLocation interface + + +Signature: + +```typescript +export interface ConsoleMessageLocation +``` + +## Properties + +| Property | 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-10.0.0/puppeteer.consolemessagelocation.url.md b/website/versioned_docs/version-10.0.0/puppeteer.consolemessagelocation.url.md new file mode 100644 index 00000000000..fe30226eb6a --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.consolemessagelocation.url.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ConsoleMessageLocation](./puppeteer.consolemessagelocation.md) > [url](./puppeteer.consolemessagelocation.url.md) + +## ConsoleMessageLocation.url property + +URL of the resource if known or `undefined` otherwise. + +Signature: + +```typescript +url?: string; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.consolemessagetype.md b/website/versioned_docs/version-10.0.0/puppeteer.consolemessagetype.md new file mode 100644 index 00000000000..d9a3e883d7d --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.consolemessagetype.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ConsoleMessageType](./puppeteer.consolemessagetype.md) + +## 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-10.0.0/puppeteer.continuerequestoverrides.headers.md b/website/versioned_docs/version-10.0.0/puppeteer.continuerequestoverrides.headers.md new file mode 100644 index 00000000000..85a062bb0b3 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.continuerequestoverrides.headers.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ContinueRequestOverrides](./puppeteer.continuerequestoverrides.md) > [headers](./puppeteer.continuerequestoverrides.headers.md) + +## ContinueRequestOverrides.headers property + +Signature: + +```typescript +headers?: Record; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.continuerequestoverrides.md b/website/versioned_docs/version-10.0.0/puppeteer.continuerequestoverrides.md new file mode 100644 index 00000000000..38e7a2decdb --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.continuerequestoverrides.md @@ -0,0 +1,22 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ContinueRequestOverrides](./puppeteer.continuerequestoverrides.md) + +## ContinueRequestOverrides interface + + +Signature: + +```typescript +export interface ContinueRequestOverrides +``` + +## Properties + +| Property | 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-10.0.0/puppeteer.continuerequestoverrides.method.md b/website/versioned_docs/version-10.0.0/puppeteer.continuerequestoverrides.method.md new file mode 100644 index 00000000000..ef17b396e1b --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.continuerequestoverrides.method.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ContinueRequestOverrides](./puppeteer.continuerequestoverrides.md) > [method](./puppeteer.continuerequestoverrides.method.md) + +## ContinueRequestOverrides.method property + +Signature: + +```typescript +method?: string; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.continuerequestoverrides.postdata.md b/website/versioned_docs/version-10.0.0/puppeteer.continuerequestoverrides.postdata.md new file mode 100644 index 00000000000..7d88853284c --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.continuerequestoverrides.postdata.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ContinueRequestOverrides](./puppeteer.continuerequestoverrides.md) > [postData](./puppeteer.continuerequestoverrides.postdata.md) + +## ContinueRequestOverrides.postData property + +Signature: + +```typescript +postData?: string; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.continuerequestoverrides.url.md b/website/versioned_docs/version-10.0.0/puppeteer.continuerequestoverrides.url.md new file mode 100644 index 00000000000..53ec6d6d870 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.continuerequestoverrides.url.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ContinueRequestOverrides](./puppeteer.continuerequestoverrides.md) > [url](./puppeteer.continuerequestoverrides.url.md) + +## ContinueRequestOverrides.url property + +If set, the request URL will change. This is not a redirect. + +Signature: + +```typescript +url?: string; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.coverage._constructor_.md b/website/versioned_docs/version-10.0.0/puppeteer.coverage._constructor_.md new file mode 100644 index 00000000000..727461d1190 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.coverage._constructor_.md @@ -0,0 +1,20 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Coverage](./puppeteer.coverage.md) > [(constructor)](./puppeteer.coverage._constructor_.md) + +## Coverage.(constructor) + +Constructs a new instance of the `Coverage` class + +Signature: + +```typescript +constructor(client: CDPSession); +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| client | [CDPSession](./puppeteer.cdpsession.md) | | + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.coverage.md b/website/versioned_docs/version-10.0.0/puppeteer.coverage.md new file mode 100644 index 00000000000..a5a1a57bbfc --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.coverage.md @@ -0,0 +1,62 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Coverage](./puppeteer.coverage.md) + +## 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: + +```js +// 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-10.0.0/puppeteer.coverage.startcsscoverage.md b/website/versioned_docs/version-10.0.0/puppeteer.coverage.startcsscoverage.md new file mode 100644 index 00000000000..2a5996d097b --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.coverage.startcsscoverage.md @@ -0,0 +1,24 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Coverage](./puppeteer.coverage.md) > [startCSSCoverage](./puppeteer.coverage.startcsscoverage.md) + +## Coverage.startCSSCoverage() method + +Signature: + +```typescript +startCSSCoverage(options?: CSSCoverageOptions): Promise; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| options | [CSSCoverageOptions](./puppeteer.csscoverageoptions.md) | 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-10.0.0/puppeteer.coverage.startjscoverage.md b/website/versioned_docs/version-10.0.0/puppeteer.coverage.startjscoverage.md new file mode 100644 index 00000000000..b4e195f3036 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.coverage.startjscoverage.md @@ -0,0 +1,28 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Coverage](./puppeteer.coverage.md) > [startJSCoverage](./puppeteer.coverage.startjscoverage.md) + +## Coverage.startJSCoverage() method + +Signature: + +```typescript +startJSCoverage(options?: JSCoverageOptions): Promise; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| options | [JSCoverageOptions](./puppeteer.jscoverageoptions.md) | 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 `__puppeteer_evaluation_script__` as their URL. + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.coverage.stopcsscoverage.md b/website/versioned_docs/version-10.0.0/puppeteer.coverage.stopcsscoverage.md new file mode 100644 index 00000000000..e926fd00624 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.coverage.stopcsscoverage.md @@ -0,0 +1,21 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Coverage](./puppeteer.coverage.md) > [stopCSSCoverage](./puppeteer.coverage.stopcsscoverage.md) + +## Coverage.stopCSSCoverage() method + +Signature: + +```typescript +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-10.0.0/puppeteer.coverage.stopjscoverage.md b/website/versioned_docs/version-10.0.0/puppeteer.coverage.stopjscoverage.md new file mode 100644 index 00000000000..9a66b035e48 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.coverage.stopjscoverage.md @@ -0,0 +1,21 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Coverage](./puppeteer.coverage.md) > [stopJSCoverage](./puppeteer.coverage.stopjscoverage.md) + +## Coverage.stopJSCoverage() method + +Signature: + +```typescript +stopJSCoverage(): Promise; +``` +Returns: + +Promise<[CoverageEntry](./puppeteer.coverageentry.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-10.0.0/puppeteer.coverageentry.md b/website/versioned_docs/version-10.0.0/puppeteer.coverageentry.md new file mode 100644 index 00000000000..2991f0d539f --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.coverageentry.md @@ -0,0 +1,22 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [CoverageEntry](./puppeteer.coverageentry.md) + +## CoverageEntry interface + +The CoverageEntry class represents one entry of the coverage report. + +Signature: + +```typescript +export interface CoverageEntry +``` + +## Properties + +| Property | 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-10.0.0/puppeteer.coverageentry.ranges.md b/website/versioned_docs/version-10.0.0/puppeteer.coverageentry.ranges.md new file mode 100644 index 00000000000..8a0ad196125 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.coverageentry.ranges.md @@ -0,0 +1,16 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [CoverageEntry](./puppeteer.coverageentry.md) > [ranges](./puppeteer.coverageentry.ranges.md) + +## CoverageEntry.ranges property + +The covered range as start and end positions. + +Signature: + +```typescript +ranges: Array<{ + start: number; + end: number; + }>; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.coverageentry.text.md b/website/versioned_docs/version-10.0.0/puppeteer.coverageentry.text.md new file mode 100644 index 00000000000..a5d3ddc629a --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.coverageentry.text.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [CoverageEntry](./puppeteer.coverageentry.md) > [text](./puppeteer.coverageentry.text.md) + +## CoverageEntry.text property + +The content of the style sheet or script. + +Signature: + +```typescript +text: string; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.coverageentry.url.md b/website/versioned_docs/version-10.0.0/puppeteer.coverageentry.url.md new file mode 100644 index 00000000000..9f33d73053b --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.coverageentry.url.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [CoverageEntry](./puppeteer.coverageentry.md) > [url](./puppeteer.coverageentry.url.md) + +## CoverageEntry.url property + +The URL of the style sheet or script. + +Signature: + +```typescript +url: string; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.credentials.md b/website/versioned_docs/version-10.0.0/puppeteer.credentials.md new file mode 100644 index 00000000000..106acd75963 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.credentials.md @@ -0,0 +1,20 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Credentials](./puppeteer.credentials.md) + +## Credentials interface + + +Signature: + +```typescript +export interface Credentials +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [password](./puppeteer.credentials.password.md) | string | | +| [username](./puppeteer.credentials.username.md) | string | | + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.credentials.password.md b/website/versioned_docs/version-10.0.0/puppeteer.credentials.password.md new file mode 100644 index 00000000000..988017ac966 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.credentials.password.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Credentials](./puppeteer.credentials.md) > [password](./puppeteer.credentials.password.md) + +## Credentials.password property + +Signature: + +```typescript +password: string; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.credentials.username.md b/website/versioned_docs/version-10.0.0/puppeteer.credentials.username.md new file mode 100644 index 00000000000..1cf2011cd6d --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.credentials.username.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Credentials](./puppeteer.credentials.md) > [username](./puppeteer.credentials.username.md) + +## Credentials.username property + +Signature: + +```typescript +username: string; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.csscoverage._client.md b/website/versioned_docs/version-10.0.0/puppeteer.csscoverage._client.md new file mode 100644 index 00000000000..1c0e553db1c --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.csscoverage._client.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [CSSCoverage](./puppeteer.csscoverage.md) > [\_client](./puppeteer.csscoverage._client.md) + +## CSSCoverage.\_client property + +Signature: + +```typescript +_client: CDPSession; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.csscoverage._constructor_.md b/website/versioned_docs/version-10.0.0/puppeteer.csscoverage._constructor_.md new file mode 100644 index 00000000000..1511bc6704d --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.csscoverage._constructor_.md @@ -0,0 +1,20 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [CSSCoverage](./puppeteer.csscoverage.md) > [(constructor)](./puppeteer.csscoverage._constructor_.md) + +## CSSCoverage.(constructor) + +Constructs a new instance of the `CSSCoverage` class + +Signature: + +```typescript +constructor(client: CDPSession); +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| client | [CDPSession](./puppeteer.cdpsession.md) | | + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.csscoverage._enabled.md b/website/versioned_docs/version-10.0.0/puppeteer.csscoverage._enabled.md new file mode 100644 index 00000000000..2bcf0402387 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.csscoverage._enabled.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [CSSCoverage](./puppeteer.csscoverage.md) > [\_enabled](./puppeteer.csscoverage._enabled.md) + +## CSSCoverage.\_enabled property + +Signature: + +```typescript +_enabled: boolean; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.csscoverage._eventlisteners.md b/website/versioned_docs/version-10.0.0/puppeteer.csscoverage._eventlisteners.md new file mode 100644 index 00000000000..6d37743663b --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.csscoverage._eventlisteners.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [CSSCoverage](./puppeteer.csscoverage.md) > [\_eventListeners](./puppeteer.csscoverage._eventlisteners.md) + +## CSSCoverage.\_eventListeners property + +Signature: + +```typescript +_eventListeners: PuppeteerEventListener[]; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.csscoverage._onexecutioncontextscleared.md b/website/versioned_docs/version-10.0.0/puppeteer.csscoverage._onexecutioncontextscleared.md new file mode 100644 index 00000000000..70210cc2b83 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.csscoverage._onexecutioncontextscleared.md @@ -0,0 +1,15 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [CSSCoverage](./puppeteer.csscoverage.md) > [\_onExecutionContextsCleared](./puppeteer.csscoverage._onexecutioncontextscleared.md) + +## CSSCoverage.\_onExecutionContextsCleared() method + +Signature: + +```typescript +_onExecutionContextsCleared(): void; +``` +Returns: + +void + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.csscoverage._onstylesheet.md b/website/versioned_docs/version-10.0.0/puppeteer.csscoverage._onstylesheet.md new file mode 100644 index 00000000000..311e6e2fc28 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.csscoverage._onstylesheet.md @@ -0,0 +1,22 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [CSSCoverage](./puppeteer.csscoverage.md) > [\_onStyleSheet](./puppeteer.csscoverage._onstylesheet.md) + +## CSSCoverage.\_onStyleSheet() method + +Signature: + +```typescript +_onStyleSheet(event: Protocol.CSS.StyleSheetAddedEvent): Promise; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| event | Protocol.CSS.StyleSheetAddedEvent | | + +Returns: + +Promise<void> + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.csscoverage._reportanonymousscripts.md b/website/versioned_docs/version-10.0.0/puppeteer.csscoverage._reportanonymousscripts.md new file mode 100644 index 00000000000..d34910e683e --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.csscoverage._reportanonymousscripts.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [CSSCoverage](./puppeteer.csscoverage.md) > [\_reportAnonymousScripts](./puppeteer.csscoverage._reportanonymousscripts.md) + +## CSSCoverage.\_reportAnonymousScripts property + +Signature: + +```typescript +_reportAnonymousScripts: boolean; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.csscoverage._resetonnavigation.md b/website/versioned_docs/version-10.0.0/puppeteer.csscoverage._resetonnavigation.md new file mode 100644 index 00000000000..ecb994ca071 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.csscoverage._resetonnavigation.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [CSSCoverage](./puppeteer.csscoverage.md) > [\_resetOnNavigation](./puppeteer.csscoverage._resetonnavigation.md) + +## CSSCoverage.\_resetOnNavigation property + +Signature: + +```typescript +_resetOnNavigation: boolean; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.csscoverage._stylesheetsources.md b/website/versioned_docs/version-10.0.0/puppeteer.csscoverage._stylesheetsources.md new file mode 100644 index 00000000000..5044bc3a395 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.csscoverage._stylesheetsources.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [CSSCoverage](./puppeteer.csscoverage.md) > [\_stylesheetSources](./puppeteer.csscoverage._stylesheetsources.md) + +## CSSCoverage.\_stylesheetSources property + +Signature: + +```typescript +_stylesheetSources: Map; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.csscoverage._stylesheeturls.md b/website/versioned_docs/version-10.0.0/puppeteer.csscoverage._stylesheeturls.md new file mode 100644 index 00000000000..2ea0794bfa8 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.csscoverage._stylesheeturls.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [CSSCoverage](./puppeteer.csscoverage.md) > [\_stylesheetURLs](./puppeteer.csscoverage._stylesheeturls.md) + +## CSSCoverage.\_stylesheetURLs property + +Signature: + +```typescript +_stylesheetURLs: Map; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.csscoverage.md b/website/versioned_docs/version-10.0.0/puppeteer.csscoverage.md new file mode 100644 index 00000000000..f76249c2f12 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.csscoverage.md @@ -0,0 +1,40 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [CSSCoverage](./puppeteer.csscoverage.md) + +## 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 | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [\_client](./puppeteer.csscoverage._client.md) | | [CDPSession](./puppeteer.cdpsession.md) | | +| [\_enabled](./puppeteer.csscoverage._enabled.md) | | boolean | | +| [\_eventListeners](./puppeteer.csscoverage._eventlisteners.md) | | [PuppeteerEventListener](./puppeteer.puppeteereventlistener.md)\[\] | | +| [\_reportAnonymousScripts](./puppeteer.csscoverage._reportanonymousscripts.md) | | boolean | | +| [\_resetOnNavigation](./puppeteer.csscoverage._resetonnavigation.md) | | boolean | | +| [\_stylesheetSources](./puppeteer.csscoverage._stylesheetsources.md) | | Map<string, string> | | +| [\_stylesheetURLs](./puppeteer.csscoverage._stylesheeturls.md) | | Map<string, string> | | + +## Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [\_onExecutionContextsCleared()](./puppeteer.csscoverage._onexecutioncontextscleared.md) | | | +| [\_onStyleSheet(event)](./puppeteer.csscoverage._onstylesheet.md) | | | +| [start(options)](./puppeteer.csscoverage.start.md) | | | +| [stop()](./puppeteer.csscoverage.stop.md) | | | + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.csscoverage.start.md b/website/versioned_docs/version-10.0.0/puppeteer.csscoverage.start.md new file mode 100644 index 00000000000..dc986e9465f --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.csscoverage.start.md @@ -0,0 +1,24 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [CSSCoverage](./puppeteer.csscoverage.md) > [start](./puppeteer.csscoverage.start.md) + +## CSSCoverage.start() method + +Signature: + +```typescript +start(options?: { + resetOnNavigation?: boolean; + }): Promise; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| options | { resetOnNavigation?: boolean; } | | + +Returns: + +Promise<void> + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.csscoverage.stop.md b/website/versioned_docs/version-10.0.0/puppeteer.csscoverage.stop.md new file mode 100644 index 00000000000..d08b2c6945a --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.csscoverage.stop.md @@ -0,0 +1,15 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [CSSCoverage](./puppeteer.csscoverage.md) > [stop](./puppeteer.csscoverage.stop.md) + +## CSSCoverage.stop() method + +Signature: + +```typescript +stop(): Promise; +``` +Returns: + +Promise<[CoverageEntry](./puppeteer.coverageentry.md)\[\]> + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.csscoverageoptions.md b/website/versioned_docs/version-10.0.0/puppeteer.csscoverageoptions.md new file mode 100644 index 00000000000..699d2f04a75 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.csscoverageoptions.md @@ -0,0 +1,20 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [CSSCoverageOptions](./puppeteer.csscoverageoptions.md) + +## CSSCoverageOptions interface + +Set of configurable options for CSS coverage. + +Signature: + +```typescript +export interface CSSCoverageOptions +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [resetOnNavigation?](./puppeteer.csscoverageoptions.resetonnavigation.md) | boolean | (Optional) Whether to reset coverage on every navigation. | + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.csscoverageoptions.resetonnavigation.md b/website/versioned_docs/version-10.0.0/puppeteer.csscoverageoptions.resetonnavigation.md new file mode 100644 index 00000000000..079ffe47c50 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.csscoverageoptions.resetonnavigation.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [CSSCoverageOptions](./puppeteer.csscoverageoptions.md) > [resetOnNavigation](./puppeteer.csscoverageoptions.resetonnavigation.md) + +## CSSCoverageOptions.resetOnNavigation property + +Whether to reset coverage on every navigation. + +Signature: + +```typescript +resetOnNavigation?: boolean; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.customerror._constructor_.md b/website/versioned_docs/version-10.0.0/puppeteer.customerror._constructor_.md new file mode 100644 index 00000000000..1d0a6b107b2 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.customerror._constructor_.md @@ -0,0 +1,20 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [CustomError](./puppeteer.customerror.md) > [(constructor)](./puppeteer.customerror._constructor_.md) + +## CustomError.(constructor) + +Constructs a new instance of the `CustomError` class + +Signature: + +```typescript +constructor(message: string); +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| message | string | | + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.customerror.md b/website/versioned_docs/version-10.0.0/puppeteer.customerror.md new file mode 100644 index 00000000000..6ff0b16151f --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.customerror.md @@ -0,0 +1,20 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [CustomError](./puppeteer.customerror.md) + +## 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-10.0.0/puppeteer.customqueryhandler.md b/website/versioned_docs/version-10.0.0/puppeteer.customqueryhandler.md new file mode 100644 index 00000000000..6aa1aa93e71 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.customqueryhandler.md @@ -0,0 +1,21 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [CustomQueryHandler](./puppeteer.customqueryhandler.md) + +## CustomQueryHandler interface + +Contains two functions `queryOne` and `queryAll` that can be [registered](./puppeteer.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 | Type | Description | +| --- | --- | --- | +| [queryAll?](./puppeteer.customqueryhandler.queryall.md) | (element: Element \| Document, selector: string) => Element\[\] \| NodeListOf<Element> | (Optional) | +| [queryOne?](./puppeteer.customqueryhandler.queryone.md) | (element: Element \| Document, selector: string) => Element \| null | (Optional) | + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.customqueryhandler.queryall.md b/website/versioned_docs/version-10.0.0/puppeteer.customqueryhandler.queryall.md new file mode 100644 index 00000000000..71b35ca8ca8 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.customqueryhandler.queryall.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [CustomQueryHandler](./puppeteer.customqueryhandler.md) > [queryAll](./puppeteer.customqueryhandler.queryall.md) + +## CustomQueryHandler.queryAll property + +Signature: + +```typescript +queryAll?: (element: Element | Document, selector: string) => Element[] | NodeListOf; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.customqueryhandler.queryone.md b/website/versioned_docs/version-10.0.0/puppeteer.customqueryhandler.queryone.md new file mode 100644 index 00000000000..7f00edadd07 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.customqueryhandler.queryone.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [CustomQueryHandler](./puppeteer.customqueryhandler.md) > [queryOne](./puppeteer.customqueryhandler.queryone.md) + +## CustomQueryHandler.queryOne property + +Signature: + +```typescript +queryOne?: (element: Element | Document, selector: string) => Element | null; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.customqueryhandlernames.md b/website/versioned_docs/version-10.0.0/puppeteer.customqueryhandlernames.md new file mode 100644 index 00000000000..d077b98b76f --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.customqueryhandlernames.md @@ -0,0 +1,17 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [customQueryHandlerNames](./puppeteer.customqueryhandlernames.md) + +## 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-10.0.0/puppeteer.device.md b/website/versioned_docs/version-10.0.0/puppeteer.device.md new file mode 100644 index 00000000000..1382b587225 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.device.md @@ -0,0 +1,21 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Device](./puppeteer.device.md) + +## Device interface + + +Signature: + +```typescript +export interface Device +``` + +## Properties + +| Property | 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-10.0.0/puppeteer.device.name.md b/website/versioned_docs/version-10.0.0/puppeteer.device.name.md new file mode 100644 index 00000000000..6d044886b48 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.device.name.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Device](./puppeteer.device.md) > [name](./puppeteer.device.name.md) + +## Device.name property + +Signature: + +```typescript +name: string; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.device.useragent.md b/website/versioned_docs/version-10.0.0/puppeteer.device.useragent.md new file mode 100644 index 00000000000..1d79e8f6093 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.device.useragent.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Device](./puppeteer.device.md) > [userAgent](./puppeteer.device.useragent.md) + +## Device.userAgent property + +Signature: + +```typescript +userAgent: string; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.device.viewport.md b/website/versioned_docs/version-10.0.0/puppeteer.device.viewport.md new file mode 100644 index 00000000000..9e16753edc3 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.device.viewport.md @@ -0,0 +1,18 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Device](./puppeteer.device.md) > [viewport](./puppeteer.device.viewport.md) + +## Device.viewport property + +Signature: + +```typescript +viewport: { + width: number; + height: number; + deviceScaleFactor: number; + isMobile: boolean; + hasTouch: boolean; + isLandscape: boolean; + }; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.devices.md b/website/versioned_docs/version-10.0.0/puppeteer.devices.md new file mode 100644 index 00000000000..97e3587397f --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.devices.md @@ -0,0 +1,16 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [devices](./puppeteer.devices.md) + +## devices variable + +Signature: + +```typescript +devices: DevicesMap +``` + +## Remarks + +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). + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.devicesmap.md b/website/versioned_docs/version-10.0.0/puppeteer.devicesmap.md new file mode 100644 index 00000000000..fb1afe4a2ad --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.devicesmap.md @@ -0,0 +1,16 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [DevicesMap](./puppeteer.devicesmap.md) + +## DevicesMap type + + +Signature: + +```typescript +export declare type DevicesMap = { + [name: string]: Device; +}; +``` +References: [Device](./puppeteer.device.md) + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.dialog.accept.md b/website/versioned_docs/version-10.0.0/puppeteer.dialog.accept.md new file mode 100644 index 00000000000..cf7386371f7 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.dialog.accept.md @@ -0,0 +1,24 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Dialog](./puppeteer.dialog.md) > [accept](./puppeteer.dialog.accept.md) + +## Dialog.accept() method + +Signature: + +```typescript +accept(promptText?: string): Promise; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| promptText | string | 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-10.0.0/puppeteer.dialog.defaultvalue.md b/website/versioned_docs/version-10.0.0/puppeteer.dialog.defaultvalue.md new file mode 100644 index 00000000000..fe83eecc105 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.dialog.defaultvalue.md @@ -0,0 +1,17 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Dialog](./puppeteer.dialog.md) > [defaultValue](./puppeteer.dialog.defaultvalue.md) + +## Dialog.defaultValue() method + +Signature: + +```typescript +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-10.0.0/puppeteer.dialog.dismiss.md b/website/versioned_docs/version-10.0.0/puppeteer.dialog.dismiss.md new file mode 100644 index 00000000000..900c286305b --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.dialog.dismiss.md @@ -0,0 +1,17 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Dialog](./puppeteer.dialog.md) > [dismiss](./puppeteer.dialog.dismiss.md) + +## Dialog.dismiss() method + +Signature: + +```typescript +dismiss(): Promise; +``` +Returns: + +Promise<void> + +A promise which will resolve once the dialog has been dismissed + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.dialog.md b/website/versioned_docs/version-10.0.0/puppeteer.dialog.md new file mode 100644 index 00000000000..13c9c277c6a --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.dialog.md @@ -0,0 +1,47 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Dialog](./puppeteer.dialog.md) + +## 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 + + +```js +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-10.0.0/puppeteer.dialog.message.md b/website/versioned_docs/version-10.0.0/puppeteer.dialog.message.md new file mode 100644 index 00000000000..e725b67f68f --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.dialog.message.md @@ -0,0 +1,17 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Dialog](./puppeteer.dialog.md) > [message](./puppeteer.dialog.message.md) + +## Dialog.message() method + +Signature: + +```typescript +message(): string; +``` +Returns: + +string + +The message displayed in the dialog. + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.dialog.type.md b/website/versioned_docs/version-10.0.0/puppeteer.dialog.type.md new file mode 100644 index 00000000000..07e789bd326 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.dialog.type.md @@ -0,0 +1,17 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Dialog](./puppeteer.dialog.md) > [type](./puppeteer.dialog.type.md) + +## Dialog.type() method + +Signature: + +```typescript +type(): Protocol.Page.DialogType; +``` +Returns: + +Protocol.Page.DialogType + +The type of the dialog. + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.elementhandle._.md b/website/versioned_docs/version-10.0.0/puppeteer.elementhandle._.md new file mode 100644 index 00000000000..80479eebc6e --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.elementhandle._.md @@ -0,0 +1,24 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ElementHandle](./puppeteer.elementhandle.md) > [$](./puppeteer.elementhandle._.md) + +## ElementHandle.$() method + +Runs `element.querySelector` within the page. If no element matches the selector, the return value resolves to `null`. + +Signature: + +```typescript +$(selector: string): Promise | null>; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| selector | string | | + +Returns: + +Promise<[ElementHandle](./puppeteer.elementhandle.md)<T> \| null> + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.elementhandle.__.md b/website/versioned_docs/version-10.0.0/puppeteer.elementhandle.__.md new file mode 100644 index 00000000000..06986b9d0f5 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.elementhandle.__.md @@ -0,0 +1,24 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ElementHandle](./puppeteer.elementhandle.md) > [$$](./puppeteer.elementhandle.__.md) + +## ElementHandle.$$() method + +Runs `element.querySelectorAll` within the page. If no elements match the selector, the return value resolves to `[]`. + +Signature: + +```typescript +$$(selector: string): Promise>>; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| selector | string | | + +Returns: + +Promise<Array<[ElementHandle](./puppeteer.elementhandle.md)<T>>> + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.elementhandle.__eval.md b/website/versioned_docs/version-10.0.0/puppeteer.elementhandle.__eval.md new file mode 100644 index 00000000000..a93ca0025ef --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.elementhandle.__eval.md @@ -0,0 +1,49 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ElementHandle](./puppeteer.elementhandle.md) > [$$eval](./puppeteer.elementhandle.__eval.md) + +## 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 +$$eval(selector: string, pageFunction: (elements: Element[], ...args: unknown[]) => ReturnType | Promise, ...args: SerializableOrJSHandle[]): Promise>; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| selector | string | | +| pageFunction | (elements: Element\[\], ...args: unknown\[\]) => ReturnType \| Promise<ReturnType> | | +| args | [SerializableOrJSHandle](./puppeteer.serializableorjshandle.md)\[\] | | + +Returns: + +Promise<[WrapElementHandle](./puppeteer.wrapelementhandle.md)<ReturnType>> + +## Example 1 + + +```html +
+
Hello!
+
Hi!
+
+ +``` + +## Example 2 + + +```js +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-10.0.0/puppeteer.elementhandle._eval.md b/website/versioned_docs/version-10.0.0/puppeteer.elementhandle._eval.md new file mode 100644 index 00000000000..9c05c4488d8 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.elementhandle._eval.md @@ -0,0 +1,38 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ElementHandle](./puppeteer.elementhandle.md) > [$eval](./puppeteer.elementhandle._eval.md) + +## 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 +$eval(selector: string, pageFunction: (element: Element, ...args: unknown[]) => ReturnType | Promise, ...args: SerializableOrJSHandle[]): Promise>; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| selector | string | | +| pageFunction | (element: Element, ...args: unknown\[\]) => ReturnType \| Promise<ReturnType> | | +| args | [SerializableOrJSHandle](./puppeteer.serializableorjshandle.md)\[\] | | + +Returns: + +Promise<[WrapElementHandle](./puppeteer.wrapelementhandle.md)<ReturnType>> + +## Example + + +```js +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-10.0.0/puppeteer.elementhandle._x.md b/website/versioned_docs/version-10.0.0/puppeteer.elementhandle._x.md new file mode 100644 index 00000000000..db94315bb94 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.elementhandle._x.md @@ -0,0 +1,24 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ElementHandle](./puppeteer.elementhandle.md) > [$x](./puppeteer.elementhandle._x.md) + +## 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 +$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<[ElementHandle](./puppeteer.elementhandle.md)\[\]> + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.elementhandle.aselement.md b/website/versioned_docs/version-10.0.0/puppeteer.elementhandle.aselement.md new file mode 100644 index 00000000000..0df27995230 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.elementhandle.aselement.md @@ -0,0 +1,15 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ElementHandle](./puppeteer.elementhandle.md) > [asElement](./puppeteer.elementhandle.aselement.md) + +## ElementHandle.asElement() method + +Signature: + +```typescript +asElement(): ElementHandle | null; +``` +Returns: + +[ElementHandle](./puppeteer.elementhandle.md)<ElementType> \| null + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.elementhandle.boundingbox.md b/website/versioned_docs/version-10.0.0/puppeteer.elementhandle.boundingbox.md new file mode 100644 index 00000000000..eda3aaebded --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.elementhandle.boundingbox.md @@ -0,0 +1,17 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ElementHandle](./puppeteer.elementhandle.md) > [boundingBox](./puppeteer.elementhandle.boundingbox.md) + +## 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 +boundingBox(): Promise; +``` +Returns: + +Promise<[BoundingBox](./puppeteer.boundingbox.md) \| null> + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.elementhandle.boxmodel.md b/website/versioned_docs/version-10.0.0/puppeteer.elementhandle.boxmodel.md new file mode 100644 index 00000000000..0e1a6679fcb --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.elementhandle.boxmodel.md @@ -0,0 +1,21 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ElementHandle](./puppeteer.elementhandle.md) > [boxModel](./puppeteer.elementhandle.boxmodel.md) + +## ElementHandle.boxModel() method + +This method returns boxes of the element, or `null` if the element is not visible. + +Signature: + +```typescript +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-10.0.0/puppeteer.elementhandle.click.md b/website/versioned_docs/version-10.0.0/puppeteer.elementhandle.click.md new file mode 100644 index 00000000000..23a2d94a11b --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.elementhandle.click.md @@ -0,0 +1,24 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ElementHandle](./puppeteer.elementhandle.md) > [click](./puppeteer.elementhandle.click.md) + +## 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 +click(options?: ClickOptions): Promise; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| options | [ClickOptions](./puppeteer.clickoptions.md) | | + +Returns: + +Promise<void> + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.elementhandle.clickablepoint.md b/website/versioned_docs/version-10.0.0/puppeteer.elementhandle.clickablepoint.md new file mode 100644 index 00000000000..b12f9217a1b --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.elementhandle.clickablepoint.md @@ -0,0 +1,15 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ElementHandle](./puppeteer.elementhandle.md) > [clickablePoint](./puppeteer.elementhandle.clickablepoint.md) + +## ElementHandle.clickablePoint() method + +Signature: + +```typescript +clickablePoint(): Promise; +``` +Returns: + +Promise<[Point](./puppeteer.point.md)> + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.elementhandle.contentframe.md b/website/versioned_docs/version-10.0.0/puppeteer.elementhandle.contentframe.md new file mode 100644 index 00000000000..186e012652e --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.elementhandle.contentframe.md @@ -0,0 +1,17 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ElementHandle](./puppeteer.elementhandle.md) > [contentFrame](./puppeteer.elementhandle.contentframe.md) + +## ElementHandle.contentFrame() method + +Resolves to the content frame for element handles referencing iframe nodes, or null otherwise + +Signature: + +```typescript +contentFrame(): Promise; +``` +Returns: + +Promise<[Frame](./puppeteer.frame.md) \| null> + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.elementhandle.drag.md b/website/versioned_docs/version-10.0.0/puppeteer.elementhandle.drag.md new file mode 100644 index 00000000000..7e16df4e21e --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.elementhandle.drag.md @@ -0,0 +1,24 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ElementHandle](./puppeteer.elementhandle.md) > [drag](./puppeteer.elementhandle.drag.md) + +## ElementHandle.drag() method + +This method creates and captures a dragevent from the element. + +Signature: + +```typescript +drag(target: Point): Promise; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| target | [Point](./puppeteer.point.md) | | + +Returns: + +Promise<Protocol.Input.DragData> + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.elementhandle.draganddrop.md b/website/versioned_docs/version-10.0.0/puppeteer.elementhandle.draganddrop.md new file mode 100644 index 00000000000..80c69427199 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.elementhandle.draganddrop.md @@ -0,0 +1,27 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ElementHandle](./puppeteer.elementhandle.md) > [dragAndDrop](./puppeteer.elementhandle.draganddrop.md) + +## ElementHandle.dragAndDrop() method + +This method triggers a dragenter, dragover, and drop on the element. + +Signature: + +```typescript +dragAndDrop(target: ElementHandle, options?: { + delay: number; + }): Promise; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| target | [ElementHandle](./puppeteer.elementhandle.md) | | +| options | { delay: number; } | | + +Returns: + +Promise<void> + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.elementhandle.dragenter.md b/website/versioned_docs/version-10.0.0/puppeteer.elementhandle.dragenter.md new file mode 100644 index 00000000000..f54d33b134f --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.elementhandle.dragenter.md @@ -0,0 +1,24 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ElementHandle](./puppeteer.elementhandle.md) > [dragEnter](./puppeteer.elementhandle.dragenter.md) + +## ElementHandle.dragEnter() method + +This method creates a `dragenter` event on the element. + +Signature: + +```typescript +dragEnter(data?: Protocol.Input.DragData): Promise; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| data | Protocol.Input.DragData | | + +Returns: + +Promise<void> + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.elementhandle.dragover.md b/website/versioned_docs/version-10.0.0/puppeteer.elementhandle.dragover.md new file mode 100644 index 00000000000..73566c16062 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.elementhandle.dragover.md @@ -0,0 +1,24 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ElementHandle](./puppeteer.elementhandle.md) > [dragOver](./puppeteer.elementhandle.dragover.md) + +## ElementHandle.dragOver() method + +This method creates a `dragover` event on the element. + +Signature: + +```typescript +dragOver(data?: Protocol.Input.DragData): Promise; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| data | Protocol.Input.DragData | | + +Returns: + +Promise<void> + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.elementhandle.drop.md b/website/versioned_docs/version-10.0.0/puppeteer.elementhandle.drop.md new file mode 100644 index 00000000000..b6470e42a7d --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.elementhandle.drop.md @@ -0,0 +1,24 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ElementHandle](./puppeteer.elementhandle.md) > [drop](./puppeteer.elementhandle.drop.md) + +## ElementHandle.drop() method + +This method triggers a drop on the element. + +Signature: + +```typescript +drop(data?: Protocol.Input.DragData): Promise; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| data | Protocol.Input.DragData | | + +Returns: + +Promise<void> + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.elementhandle.focus.md b/website/versioned_docs/version-10.0.0/puppeteer.elementhandle.focus.md new file mode 100644 index 00000000000..4509b290a90 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.elementhandle.focus.md @@ -0,0 +1,17 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ElementHandle](./puppeteer.elementhandle.md) > [focus](./puppeteer.elementhandle.focus.md) + +## ElementHandle.focus() method + +Calls [focus](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus) on the element. + +Signature: + +```typescript +focus(): Promise; +``` +Returns: + +Promise<void> + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.elementhandle.hover.md b/website/versioned_docs/version-10.0.0/puppeteer.elementhandle.hover.md new file mode 100644 index 00000000000..30943ba1147 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.elementhandle.hover.md @@ -0,0 +1,17 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ElementHandle](./puppeteer.elementhandle.md) > [hover](./puppeteer.elementhandle.hover.md) + +## 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 +hover(): Promise; +``` +Returns: + +Promise<void> + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.elementhandle.isintersectingviewport.md b/website/versioned_docs/version-10.0.0/puppeteer.elementhandle.isintersectingviewport.md new file mode 100644 index 00000000000..4621338b8c0 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.elementhandle.isintersectingviewport.md @@ -0,0 +1,17 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ElementHandle](./puppeteer.elementhandle.md) > [isIntersectingViewport](./puppeteer.elementhandle.isintersectingviewport.md) + +## ElementHandle.isIntersectingViewport() method + +Resolves to true if the element is visible in the current viewport. + +Signature: + +```typescript +isIntersectingViewport(): Promise; +``` +Returns: + +Promise<boolean> + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.elementhandle.md b/website/versioned_docs/version-10.0.0/puppeteer.elementhandle.md new file mode 100644 index 00000000000..8670c079337 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.elementhandle.md @@ -0,0 +1,63 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ElementHandle](./puppeteer.elementhandle.md) + +## ElementHandle class + +ElementHandle represents an in-page DOM element. + +Signature: + +```typescript +export declare class ElementHandle extends JSHandle +``` +Extends: [JSHandle](./puppeteer.jshandle.md)<ElementType> + +## Remarks + +ElementHandles can be created with the [Page.$()](./puppeteer.page._.md) method. + +```js +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 +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 + + +```js +handle.select('blue'); // single selection +handle.select('red', 'green', 'blue'); // multiple selections + +``` + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.elementhandle.tap.md b/website/versioned_docs/version-10.0.0/puppeteer.elementhandle.tap.md new file mode 100644 index 00000000000..a694242045e --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.elementhandle.tap.md @@ -0,0 +1,17 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ElementHandle](./puppeteer.elementhandle.md) > [tap](./puppeteer.elementhandle.tap.md) + +## 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 +tap(): Promise; +``` +Returns: + +Promise<void> + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.elementhandle.type.md b/website/versioned_docs/version-10.0.0/puppeteer.elementhandle.type.md new file mode 100644 index 00000000000..3a64609b67a --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.elementhandle.type.md @@ -0,0 +1,49 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ElementHandle](./puppeteer.elementhandle.md) > [type](./puppeteer.elementhandle.type.md) + +## 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 +type(text: string, options?: { + delay: number; + }): Promise; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| text | string | | +| options | { delay: number; } | | + +Returns: + +Promise<void> + +## Example 1 + + +```js +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: + +```js +const elementHandle = await page.$('input'); +await elementHandle.type('some text'); +await elementHandle.press('Enter'); + +``` + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.elementhandle.uploadfile.md b/website/versioned_docs/version-10.0.0/puppeteer.elementhandle.uploadfile.md new file mode 100644 index 00000000000..a4d1b4cd02e --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.elementhandle.uploadfile.md @@ -0,0 +1,24 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ElementHandle](./puppeteer.elementhandle.md) > [uploadFile](./puppeteer.elementhandle.uploadfile.md) + +## 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 +uploadFile(...filePaths: string[]): Promise; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| filePaths | string\[\] | Sets the value of the file input to these paths. 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-10.0.0/puppeteer.errorcode.md b/website/versioned_docs/version-10.0.0/puppeteer.errorcode.md new file mode 100644 index 00000000000..5ab270c5428 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.errorcode.md @@ -0,0 +1,12 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ErrorCode](./puppeteer.errorcode.md) + +## 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-10.0.0/puppeteer.errors.md b/website/versioned_docs/version-10.0.0/puppeteer.errors.md new file mode 100644 index 00000000000..15c99b8764d --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.errors.md @@ -0,0 +1,12 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [errors](./puppeteer.errors.md) + +## errors variable + + +Signature: + +```typescript +errors: PuppeteerErrors +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.evaluatefn.md b/website/versioned_docs/version-10.0.0/puppeteer.evaluatefn.md new file mode 100644 index 00000000000..23f80a34760 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.evaluatefn.md @@ -0,0 +1,12 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [EvaluateFn](./puppeteer.evaluatefn.md) + +## EvaluateFn type + + +Signature: + +```typescript +export declare type EvaluateFn = string | ((arg1: T, ...args: any[]) => any); +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.evaluatefnreturntype.md b/website/versioned_docs/version-10.0.0/puppeteer.evaluatefnreturntype.md new file mode 100644 index 00000000000..6829af5ad03 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.evaluatefnreturntype.md @@ -0,0 +1,14 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [EvaluateFnReturnType](./puppeteer.evaluatefnreturntype.md) + +## EvaluateFnReturnType type + + +Signature: + +```typescript +export declare type EvaluateFnReturnType = T extends (...args: any[]) => infer R ? R : any; +``` +References: [EvaluateFn](./puppeteer.evaluatefn.md) + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.evaluatehandlefn.md b/website/versioned_docs/version-10.0.0/puppeteer.evaluatehandlefn.md new file mode 100644 index 00000000000..22191cfef5c --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.evaluatehandlefn.md @@ -0,0 +1,12 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [EvaluateHandleFn](./puppeteer.evaluatehandlefn.md) + +## EvaluateHandleFn type + + +Signature: + +```typescript +export declare type EvaluateHandleFn = string | ((...args: any[]) => any); +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.evaluation_script_url.md b/website/versioned_docs/version-10.0.0/puppeteer.evaluation_script_url.md new file mode 100644 index 00000000000..ab5912e6c2e --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.evaluation_script_url.md @@ -0,0 +1,12 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [EVALUATION\_SCRIPT\_URL](./puppeteer.evaluation_script_url.md) + +## EVALUATION\_SCRIPT\_URL variable + + +Signature: + +```typescript +EVALUATION_SCRIPT_URL = "__puppeteer_evaluation_script__" +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.eventemitter.addlistener.md b/website/versioned_docs/version-10.0.0/puppeteer.eventemitter.addlistener.md new file mode 100644 index 00000000000..d492b3d8896 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.eventemitter.addlistener.md @@ -0,0 +1,30 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [EventEmitter](./puppeteer.eventemitter.md) > [addListener](./puppeteer.eventemitter.addlistener.md) + +## EventEmitter.addListener() method + +> Warning: This API is now obsolete. +> +> please use [EventEmitter.on()](./puppeteer.eventemitter.on.md) instead. +> + +Add an event listener. + +Signature: + +```typescript +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-10.0.0/puppeteer.eventemitter.emit.md b/website/versioned_docs/version-10.0.0/puppeteer.eventemitter.emit.md new file mode 100644 index 00000000000..1db43ac7270 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.eventemitter.emit.md @@ -0,0 +1,27 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [EventEmitter](./puppeteer.eventemitter.md) > [emit](./puppeteer.eventemitter.emit.md) + +## EventEmitter.emit() method + +Emit an event and call any associated listeners. + +Signature: + +```typescript +emit(event: EventType, eventData?: unknown): boolean; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| event | [EventType](./puppeteer.eventtype.md) | the event you'd like to emit | +| eventData | unknown | 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-10.0.0/puppeteer.eventemitter.listenercount.md b/website/versioned_docs/version-10.0.0/puppeteer.eventemitter.listenercount.md new file mode 100644 index 00000000000..6b6d7792b01 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.eventemitter.listenercount.md @@ -0,0 +1,26 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [EventEmitter](./puppeteer.eventemitter.md) > [listenerCount](./puppeteer.eventemitter.listenercount.md) + +## EventEmitter.listenerCount() method + +Gets the number of listeners for a given event. + +Signature: + +```typescript +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-10.0.0/puppeteer.eventemitter.md b/website/versioned_docs/version-10.0.0/puppeteer.eventemitter.md new file mode 100644 index 00000000000..634d9a569ed --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.eventemitter.md @@ -0,0 +1,34 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [EventEmitter](./puppeteer.eventemitter.md) + +## 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-10.0.0/puppeteer.eventemitter.off.md b/website/versioned_docs/version-10.0.0/puppeteer.eventemitter.off.md new file mode 100644 index 00000000000..71578a24dcd --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.eventemitter.off.md @@ -0,0 +1,27 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [EventEmitter](./puppeteer.eventemitter.md) > [off](./puppeteer.eventemitter.off.md) + +## EventEmitter.off() method + +Remove an event listener from firing. + +Signature: + +```typescript +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-10.0.0/puppeteer.eventemitter.on.md b/website/versioned_docs/version-10.0.0/puppeteer.eventemitter.on.md new file mode 100644 index 00000000000..d6bcf47a58c --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.eventemitter.on.md @@ -0,0 +1,27 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [EventEmitter](./puppeteer.eventemitter.md) > [on](./puppeteer.eventemitter.on.md) + +## EventEmitter.on() method + +Bind an event listener to fire when an event occurs. + +Signature: + +```typescript +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-10.0.0/puppeteer.eventemitter.once.md b/website/versioned_docs/version-10.0.0/puppeteer.eventemitter.once.md new file mode 100644 index 00000000000..39cd7dd483e --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.eventemitter.once.md @@ -0,0 +1,27 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [EventEmitter](./puppeteer.eventemitter.md) > [once](./puppeteer.eventemitter.once.md) + +## EventEmitter.once() method + +Like `on` but the listener will only be fired once and then it will be removed. + +Signature: + +```typescript +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-10.0.0/puppeteer.eventemitter.removealllisteners.md b/website/versioned_docs/version-10.0.0/puppeteer.eventemitter.removealllisteners.md new file mode 100644 index 00000000000..d03627c9707 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.eventemitter.removealllisteners.md @@ -0,0 +1,26 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [EventEmitter](./puppeteer.eventemitter.md) > [removeAllListeners](./puppeteer.eventemitter.removealllisteners.md) + +## EventEmitter.removeAllListeners() method + +Removes all listeners. If given an event argument, it will remove only listeners for that event. + +Signature: + +```typescript +removeAllListeners(event?: EventType): EventEmitter; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| event | [EventType](./puppeteer.eventtype.md) | 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-10.0.0/puppeteer.eventemitter.removelistener.md b/website/versioned_docs/version-10.0.0/puppeteer.eventemitter.removelistener.md new file mode 100644 index 00000000000..c388eb33002 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.eventemitter.removelistener.md @@ -0,0 +1,30 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [EventEmitter](./puppeteer.eventemitter.md) > [removeListener](./puppeteer.eventemitter.removelistener.md) + +## EventEmitter.removeListener() method + +> Warning: This API is now obsolete. +> +> please use [EventEmitter.off()](./puppeteer.eventemitter.off.md) instead. +> + +Remove an event listener. + +Signature: + +```typescript +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-10.0.0/puppeteer.eventtype.md b/website/versioned_docs/version-10.0.0/puppeteer.eventtype.md new file mode 100644 index 00000000000..81a51014baa --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.eventtype.md @@ -0,0 +1,12 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [EventType](./puppeteer.eventtype.md) + +## EventType type + + +Signature: + +```typescript +export declare type EventType = string | symbol; +``` diff --git a/website/versioned_docs/version-10.0.0/puppeteer.executioncontext.evaluate.md b/website/versioned_docs/version-10.0.0/puppeteer.executioncontext.evaluate.md new file mode 100644 index 00000000000..e1e532814ab --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.executioncontext.evaluate.md @@ -0,0 +1,64 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ExecutionContext](./puppeteer.executioncontext.md) > [evaluate](./puppeteer.executioncontext.evaluate.md) + +## ExecutionContext.evaluate() method + +Signature: + +```typescript +evaluate(pageFunction: Function | string, ...args: unknown[]): Promise; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pageFunction | Function \| string | a function to be evaluated in the executionContext | +| args | unknown\[\] | argument to pass to the page function | + +Returns: + +Promise<ReturnType> + +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 + + +```js +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. + +```js +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`: + +```js +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-10.0.0/puppeteer.executioncontext.evaluatehandle.md b/website/versioned_docs/version-10.0.0/puppeteer.executioncontext.evaluatehandle.md new file mode 100644 index 00000000000..e8c9e3d4da8 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.executioncontext.evaluatehandle.md @@ -0,0 +1,62 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ExecutionContext](./puppeteer.executioncontext.md) > [evaluateHandle](./puppeteer.executioncontext.evaluatehandle.md) + +## ExecutionContext.evaluateHandle() method + +Signature: + +```typescript +evaluateHandle(pageFunction: EvaluateHandleFn, ...args: SerializableOrJSHandle[]): Promise; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pageFunction | [EvaluateHandleFn](./puppeteer.evaluatehandlefn.md) | a function to be evaluated in the executionContext | +| args | [SerializableOrJSHandle](./puppeteer.serializableorjshandle.md)\[\] | argument to pass to the page function | + +Returns: + +Promise<HandleType> + +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 + + +```js +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. + +```js +// 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`: + +```js +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-10.0.0/puppeteer.executioncontext.frame.md b/website/versioned_docs/version-10.0.0/puppeteer.executioncontext.frame.md new file mode 100644 index 00000000000..be7d61d40b0 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.executioncontext.frame.md @@ -0,0 +1,21 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ExecutionContext](./puppeteer.executioncontext.md) > [frame](./puppeteer.executioncontext.frame.md) + +## ExecutionContext.frame() method + +Signature: + +```typescript +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-10.0.0/puppeteer.executioncontext.md b/website/versioned_docs/version-10.0.0/puppeteer.executioncontext.md new file mode 100644 index 00000000000..88699a5d32d --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.executioncontext.md @@ -0,0 +1,29 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ExecutionContext](./puppeteer.executioncontext.md) + +## 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-10.0.0/puppeteer.executioncontext.queryobjects.md b/website/versioned_docs/version-10.0.0/puppeteer.executioncontext.queryobjects.md new file mode 100644 index 00000000000..abeea9c340f --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.executioncontext.queryobjects.md @@ -0,0 +1,46 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [ExecutionContext](./puppeteer.executioncontext.md) > [queryObjects](./puppeteer.executioncontext.queryobjects.md) + +## ExecutionContext.queryObjects() method + +This method iterates the JavaScript heap and finds all the objects with the given prototype. + +Signature: + +```typescript +queryObjects(prototypeHandle: JSHandle): Promise; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| prototypeHandle | [JSHandle](./puppeteer.jshandle.md) | a handle to the object prototype | + +Returns: + +Promise<[JSHandle](./puppeteer.jshandle.md)> + +A handle to an array of objects with the given prototype. + +## Remarks + + +## Example + + +```js +// 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-10.0.0/puppeteer.filechooser.accept.md b/website/versioned_docs/version-10.0.0/puppeteer.filechooser.accept.md new file mode 100644 index 00000000000..173ec7c659f --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.filechooser.accept.md @@ -0,0 +1,24 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [FileChooser](./puppeteer.filechooser.md) > [accept](./puppeteer.filechooser.accept.md) + +## FileChooser.accept() method + +Accept the file chooser request with given paths. + +Signature: + +```typescript +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-10.0.0/puppeteer.filechooser.cancel.md b/website/versioned_docs/version-10.0.0/puppeteer.filechooser.cancel.md new file mode 100644 index 00000000000..6e557e07ac1 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.filechooser.cancel.md @@ -0,0 +1,17 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [FileChooser](./puppeteer.filechooser.md) > [cancel](./puppeteer.filechooser.cancel.md) + +## FileChooser.cancel() method + +Closes the file chooser without selecting any files. + +Signature: + +```typescript +cancel(): void; +``` +Returns: + +void + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.filechooser.ismultiple.md b/website/versioned_docs/version-10.0.0/puppeteer.filechooser.ismultiple.md new file mode 100644 index 00000000000..58e54a02bae --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.filechooser.ismultiple.md @@ -0,0 +1,17 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [FileChooser](./puppeteer.filechooser.md) > [isMultiple](./puppeteer.filechooser.ismultiple.md) + +## 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 +isMultiple(): boolean; +``` +Returns: + +boolean + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.filechooser.md b/website/versioned_docs/version-10.0.0/puppeteer.filechooser.md new file mode 100644 index 00000000000..77738b1a4e0 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.filechooser.md @@ -0,0 +1,42 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [FileChooser](./puppeteer.filechooser.md) + +## 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`: + +```js +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-10.0.0/puppeteer.frame._.md b/website/versioned_docs/version-10.0.0/puppeteer.frame._.md new file mode 100644 index 00000000000..8250f209e7f --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.frame._.md @@ -0,0 +1,26 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Frame](./puppeteer.frame.md) > [$](./puppeteer.frame._.md) + +## Frame.$() method + +This method queries the frame for the given selector. + +Signature: + +```typescript +$(selector: string): Promise | null>; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| selector | string | a selector to query for. | + +Returns: + +Promise<[ElementHandle](./puppeteer.elementhandle.md)<T> \| 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-10.0.0/puppeteer.frame.__.md b/website/versioned_docs/version-10.0.0/puppeteer.frame.__.md new file mode 100644 index 00000000000..32b33da9831 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.frame.__.md @@ -0,0 +1,26 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Frame](./puppeteer.frame.md) > [$$](./puppeteer.frame.__.md) + +## Frame.$$() method + +This runs `document.querySelectorAll` in the frame and returns the result. + +Signature: + +```typescript +$$(selector: string): Promise>>; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| selector | string | a selector to search for | + +Returns: + +Promise<Array<[ElementHandle](./puppeteer.elementhandle.md)<T>>> + +An array of element handles pointing to the found frame elements. + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.frame.__eval.md b/website/versioned_docs/version-10.0.0/puppeteer.frame.__eval.md new file mode 100644 index 00000000000..bf26a652f24 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.frame.__eval.md @@ -0,0 +1,38 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Frame](./puppeteer.frame.md) > [$$eval](./puppeteer.frame.__eval.md) + +## Frame.$$eval() method + +Signature: + +```typescript +$$eval(selector: string, pageFunction: (elements: Element[], ...args: unknown[]) => ReturnType | Promise, ...args: SerializableOrJSHandle[]): Promise>; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| selector | string | the selector to query for | +| pageFunction | (elements: Element\[\], ...args: unknown\[\]) => ReturnType \| Promise<ReturnType> | the function to be evaluated in the frame's context | +| args | [SerializableOrJSHandle](./puppeteer.serializableorjshandle.md)\[\] | additional arguments to pass to pageFuncton | + +Returns: + +Promise<[WrapElementHandle](./puppeteer.wrapelementhandle.md)<ReturnType>> + +## 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 + + +```js +const divsCounts = await frame.$$eval('div', divs => divs.length); + +``` + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.frame._eval.md b/website/versioned_docs/version-10.0.0/puppeteer.frame._eval.md new file mode 100644 index 00000000000..32c7f440637 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.frame._eval.md @@ -0,0 +1,38 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Frame](./puppeteer.frame.md) > [$eval](./puppeteer.frame._eval.md) + +## Frame.$eval() method + +Signature: + +```typescript +$eval(selector: string, pageFunction: (element: Element, ...args: unknown[]) => ReturnType | Promise, ...args: SerializableOrJSHandle[]): Promise>; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| selector | string | the selector to query for | +| pageFunction | (element: Element, ...args: unknown\[\]) => ReturnType \| Promise<ReturnType> | the function to be evaluated in the frame's context | +| args | [SerializableOrJSHandle](./puppeteer.serializableorjshandle.md)\[\] | additional arguments to pass to pageFuncton | + +Returns: + +Promise<[WrapElementHandle](./puppeteer.wrapelementhandle.md)<ReturnType>> + +## 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 + + +```js +const searchValue = await frame.$eval('#search', el => el.value); + +``` + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.frame._x.md b/website/versioned_docs/version-10.0.0/puppeteer.frame._x.md new file mode 100644 index 00000000000..dc07d590893 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.frame._x.md @@ -0,0 +1,24 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Frame](./puppeteer.frame.md) > [$x](./puppeteer.frame._x.md) + +## Frame.$x() method + +This method evaluates the given XPath expression and returns the results. + +Signature: + +```typescript +$x(expression: string): Promise; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| expression | string | the XPath expression to evaluate. | + +Returns: + +Promise<[ElementHandle](./puppeteer.elementhandle.md)\[\]> + diff --git a/website/versioned_docs/version-10.0.0/puppeteer.frame.addscripttag.md b/website/versioned_docs/version-10.0.0/puppeteer.frame.addscripttag.md new file mode 100644 index 00000000000..658a6fa85b2 --- /dev/null +++ b/website/versioned_docs/version-10.0.0/puppeteer.frame.addscripttag.md @@ -0,0 +1,26 @@ + + +[Home](./index.md) > [puppeteer](./puppeteer.md) > [Frame](./puppeteer.frame.md) > [addScriptTag](./puppeteer.frame.addscripttag.md) + +## Frame.addScriptTag() method + +Adds a `