diff --git a/.release-please-manifest.json b/.release-please-manifest.json index c516b1465e7..b6817cab54b 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,6 +1,6 @@ { - "packages/puppeteer": "21.2.1", - "packages/puppeteer-core": "21.2.1", + "packages/puppeteer": "21.3.0", + "packages/puppeteer-core": "21.3.0", "packages/testserver": "0.6.0", "packages/ng-schematics": "0.5.0", "packages/browsers": "1.7.1" diff --git a/package-lock.json b/package-lock.json index dd1017d08d7..319a5b78a6e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11406,20 +11406,20 @@ } }, "packages/puppeteer": { - "version": "21.2.1", + "version": "21.3.0", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { "@puppeteer/browsers": "1.7.1", "cosmiconfig": "8.3.6", - "puppeteer-core": "21.2.1" + "puppeteer-core": "21.3.0" }, "engines": { "node": ">=16.3.0" } }, "packages/puppeteer-core": { - "version": "21.2.1", + "version": "21.3.0", "license": "Apache-2.0", "dependencies": { "@puppeteer/browsers": "1.7.1", diff --git a/packages/puppeteer-core/CHANGELOG.md b/packages/puppeteer-core/CHANGELOG.md index 7d7e0a6bd3e..a27c4354e4a 100644 --- a/packages/puppeteer-core/CHANGELOG.md +++ b/packages/puppeteer-core/CHANGELOG.md @@ -20,6 +20,25 @@ All notable changes to this project will be documented in this file. See [standa * dependencies * @puppeteer/browsers bumped from 1.5.1 to 1.6.0 +## [21.3.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-core-v21.2.1...puppeteer-core-v21.3.0) (2023-09-19) + + +### Features + +* implement `Browser.connected` ([#10927](https://github.com/puppeteer/puppeteer/issues/10927)) ([a4345a4](https://github.com/puppeteer/puppeteer/commit/a4345a477f58541f5d95da11ffee74abe24c12bf)) +* implement `BrowserContext.closed` ([#10928](https://github.com/puppeteer/puppeteer/issues/10928)) ([2292078](https://github.com/puppeteer/puppeteer/commit/2292078969fa46a27d5759989cd44a4d48beb310)) +* implement improved Drag n' Drop APIs ([#10651](https://github.com/puppeteer/puppeteer/issues/10651)) ([9342bac](https://github.com/puppeteer/puppeteer/commit/9342bac2639702090f39fc1e3a97d43a934f3f0b)) +* implement typed events ([#10889](https://github.com/puppeteer/puppeteer/issues/10889)) ([9b6f1de](https://github.com/puppeteer/puppeteer/commit/9b6f1de8b99445c661c5aebcf041fe90daf469b9)) +* roll to Chrome 117.0.5938.62 (r1181205) ([#10893](https://github.com/puppeteer/puppeteer/issues/10893)) ([4b8d20d](https://github.com/puppeteer/puppeteer/commit/4b8d20d0edeccaa3028e0c1c0b63c022cfabcee2)) + + +### Bug Fixes + +* fix line/column number in errors ([#10926](https://github.com/puppeteer/puppeteer/issues/10926)) ([a0e57f7](https://github.com/puppeteer/puppeteer/commit/a0e57f7eb230ba6a659c2d418da8d3f67add2d00)) +* handle frame manager init without unhandled rejection ([#10902](https://github.com/puppeteer/puppeteer/issues/10902)) ([ea14834](https://github.com/puppeteer/puppeteer/commit/ea14834fdf1c7c1afa45bdd1fb5339380f4631a2)) +* remove explicit resource management from types ([#10918](https://github.com/puppeteer/puppeteer/issues/10918)) ([a1b1bff](https://github.com/puppeteer/puppeteer/commit/a1b1bffb7258f1dec3b0a2e9ce068baf2cc3db19)) +* roll to Chrome 117.0.5938.88 (r1181205) ([#10920](https://github.com/puppeteer/puppeteer/issues/10920)) ([b7bcc9a](https://github.com/puppeteer/puppeteer/commit/b7bcc9a733a3ac376397a32c3f62eb68101bedf9)) + ## [21.2.1](https://github.com/puppeteer/puppeteer/compare/puppeteer-core-v21.2.0...puppeteer-core-v21.2.1) (2023-09-13) diff --git a/packages/puppeteer-core/package.json b/packages/puppeteer-core/package.json index d62ebdc4b18..39927a978ac 100644 --- a/packages/puppeteer-core/package.json +++ b/packages/puppeteer-core/package.json @@ -1,6 +1,6 @@ { "name": "puppeteer-core", - "version": "21.2.1", + "version": "21.3.0", "description": "A high-level API to control headless Chrome over the DevTools Protocol", "keywords": [ "puppeteer", diff --git a/packages/puppeteer/CHANGELOG.md b/packages/puppeteer/CHANGELOG.md index cbf3baff3dc..d61edb123df 100644 --- a/packages/puppeteer/CHANGELOG.md +++ b/packages/puppeteer/CHANGELOG.md @@ -29,6 +29,20 @@ All notable changes to this project will be documented in this file. See [standa * puppeteer-core bumped from 21.0.2 to 21.0.3 * @puppeteer/browsers bumped from 1.5.1 to 1.6.0 +## [21.3.0](https://github.com/puppeteer/puppeteer/compare/puppeteer-v21.2.1...puppeteer-v21.3.0) (2023-09-19) + + +### Miscellaneous Chores + +* **puppeteer:** Synchronize puppeteer versions + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * puppeteer-core bumped from 21.2.1 to 21.3.0 + ## [21.2.1](https://github.com/puppeteer/puppeteer/compare/puppeteer-v21.2.0...puppeteer-v21.2.1) (2023-09-13) diff --git a/packages/puppeteer/package.json b/packages/puppeteer/package.json index b4fc5564194..b0357109296 100644 --- a/packages/puppeteer/package.json +++ b/packages/puppeteer/package.json @@ -1,6 +1,6 @@ { "name": "puppeteer", - "version": "21.2.1", + "version": "21.3.0", "description": "A high-level API to control headless Chrome over the DevTools Protocol", "keywords": [ "puppeteer", @@ -122,7 +122,7 @@ "license": "Apache-2.0", "dependencies": { "cosmiconfig": "8.3.6", - "puppeteer-core": "21.2.1", + "puppeteer-core": "21.3.0", "@puppeteer/browsers": "1.7.1" } } diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.browser._symbol.asyncdispose_.md b/website/versioned_docs/version-21.2.1/api/puppeteer.browser._symbol.asyncdispose_.md deleted file mode 100644 index 50e0ae9bfc4..00000000000 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.browser._symbol.asyncdispose_.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -sidebar_label: Browser.[Symbol.asyncDispose] ---- - -# Browser.\[Symbol.asyncDispose\]() method - -#### Signature: - -```typescript -class Browser { - [Symbol.asyncDispose](): Promise; -} -``` - -**Returns:** - -Promise<void> diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.browser._symbol.dispose_.md b/website/versioned_docs/version-21.2.1/api/puppeteer.browser._symbol.dispose_.md deleted file mode 100644 index e7a9f6579fc..00000000000 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.browser._symbol.dispose_.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -sidebar_label: Browser.[Symbol.dispose] ---- - -# Browser.\[Symbol.dispose\]() method - -#### Signature: - -```typescript -class Browser { - [Symbol.dispose](): void; -} -``` - -**Returns:** - -void diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.browser.browsercontexts.md b/website/versioned_docs/version-21.2.1/api/puppeteer.browser.browsercontexts.md deleted file mode 100644 index 1e81e41eb0f..00000000000 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.browser.browsercontexts.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -sidebar_label: Browser.browserContexts ---- - -# Browser.browserContexts() method - -Returns an array of all open browser contexts. In a newly created browser, this will return a single instance of [BrowserContext](./puppeteer.browsercontext.md). - -#### Signature: - -```typescript -class Browser { - browserContexts(): BrowserContext[]; -} -``` - -**Returns:** - -[BrowserContext](./puppeteer.browsercontext.md)\[\] diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.browser.close.md b/website/versioned_docs/version-21.2.1/api/puppeteer.browser.close.md deleted file mode 100644 index b7c30033e6d..00000000000 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.browser.close.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -sidebar_label: Browser.close ---- - -# Browser.close() method - -Closes the browser and all of its pages (if any were opened). The [Browser](./puppeteer.browser.md) object itself is considered to be disposed and cannot be used anymore. - -#### Signature: - -```typescript -class Browser { - close(): Promise; -} -``` - -**Returns:** - -Promise<void> diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.browser.disconnect.md b/website/versioned_docs/version-21.2.1/api/puppeteer.browser.disconnect.md deleted file mode 100644 index c102c10b094..00000000000 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.browser.disconnect.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -sidebar_label: Browser.disconnect ---- - -# Browser.disconnect() method - -Disconnects Puppeteer from the browser, but leaves the browser process running. After calling `disconnect`, the [Browser](./puppeteer.browser.md) object is considered disposed and cannot be used anymore. - -#### Signature: - -```typescript -class Browser { - disconnect(): void; -} -``` - -**Returns:** - -void diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.browser.md b/website/versioned_docs/version-21.2.1/api/puppeteer.browser.md deleted file mode 100644 index 634c62174a3..00000000000 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.browser.md +++ /dev/null @@ -1,81 +0,0 @@ ---- -sidebar_label: Browser ---- - -# Browser class - -A Browser is created when Puppeteer connects to a browser instance, either through [PuppeteerNode.launch()](./puppeteer.puppeteernode.launch.md) or [Puppeteer.connect()](./puppeteer.puppeteer.connect.md). - -#### Signature: - -```typescript -export declare class Browser extends EventEmitter implements AsyncDisposable, Disposable -``` - -**Extends:** [EventEmitter](./puppeteer.eventemitter.md) - -**Implements:** AsyncDisposable, Disposable - -## Remarks - -The Browser class extends from Puppeteer's [EventEmitter](./puppeteer.eventemitter.md) class and will emit various events which are documented in the [BrowserEmittedEvents](./puppeteer.browseremittedevents.md) enum. - -The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `Browser` class. - -## Example 1 - -An example of using a [Browser](./puppeteer.browser.md) to create a [Page](./puppeteer.page.md): - -```ts -import puppeteer from 'puppeteer'; - -(async () => { - const browser = await puppeteer.launch(); - const page = await browser.newPage(); - await page.goto('https://example.com'); - await browser.close(); -})(); -``` - -## Example 2 - -An example of disconnecting from and reconnecting to a [Browser](./puppeteer.browser.md): - -```ts -import puppeteer from 'puppeteer'; - -(async () => { - const browser = await puppeteer.launch(); - // Store the endpoint to be able to reconnect to the browser. - const browserWSEndpoint = browser.wsEndpoint(); - // Disconnect puppeteer from the browser. - browser.disconnect(); - - // Use the endpoint to reestablish a connection - const browser2 = await puppeteer.connect({browserWSEndpoint}); - // Close the browser. - await browser2.close(); -})(); -``` - -## Methods - -| Method | Modifiers | Description | -| ---------------------------------------------------------------------------------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [\[Symbol.asyncDispose\]()](./puppeteer.browser._symbol.asyncdispose_.md) | | | -| [\[Symbol.dispose\]()](./puppeteer.browser._symbol.dispose_.md) | | | -| [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 the browser and all of its pages (if any were opened). The [Browser](./puppeteer.browser.md) object itself is considered to be disposed and cannot be used anymore. | -| [createIncognitoBrowserContext(options)](./puppeteer.browser.createincognitobrowsercontext.md) | | Creates a new incognito browser context. This won't share cookies/cache with other browser contexts. | -| [defaultBrowserContext()](./puppeteer.browser.defaultbrowsercontext.md) | | Returns the default browser context. The default browser context cannot be closed. | -| [disconnect()](./puppeteer.browser.disconnect.md) | | Disconnects Puppeteer from the browser, but leaves the browser 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-21.2.1/api/puppeteer.browser.pages.md b/website/versioned_docs/version-21.2.1/api/puppeteer.browser.pages.md deleted file mode 100644 index 3b136c48955..00000000000 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.browser.pages.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -sidebar_label: Browser.pages ---- - -# Browser.pages() method - -An array of all open pages inside the Browser. - -#### Signature: - -```typescript -class Browser { - pages(): Promise; -} -``` - -**Returns:** - -Promise<[Page](./puppeteer.page.md)\[\]> - -## Remarks - -In case of multiple browser contexts, returns an array with all the pages in all browser contexts. Non-visible pages, such as `"background_page"`, will not be listed here. You can find them using [Target.page()](./puppeteer.target.page.md). diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.browser.process.md b/website/versioned_docs/version-21.2.1/api/puppeteer.browser.process.md deleted file mode 100644 index 27c794c7b45..00000000000 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.browser.process.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -sidebar_label: Browser.process ---- - -# Browser.process() method - -The spawned browser process. Returns `null` if the browser instance was created with [Puppeteer.connect()](./puppeteer.puppeteer.connect.md). - -#### Signature: - -```typescript -class Browser { - process(): ChildProcess | null; -} -``` - -**Returns:** - -ChildProcess \| null diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.browser.targets.md b/website/versioned_docs/version-21.2.1/api/puppeteer.browser.targets.md deleted file mode 100644 index 2af3229cd86..00000000000 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.browser.targets.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -sidebar_label: Browser.targets ---- - -# Browser.targets() method - -All active targets inside the Browser. In case of multiple browser contexts, returns an array with all the targets in all browser contexts. - -#### Signature: - -```typescript -class Browser { - targets(): Target[]; -} -``` - -**Returns:** - -[Target](./puppeteer.target.md)\[\] diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.browser.version.md b/website/versioned_docs/version-21.2.1/api/puppeteer.browser.version.md deleted file mode 100644 index ed6b027b216..00000000000 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.browser.version.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -sidebar_label: Browser.version ---- - -# Browser.version() method - -A string representing the browser name and version. - -#### Signature: - -```typescript -class Browser { - version(): Promise; -} -``` - -**Returns:** - -Promise<string> - -## Remarks - -For headless browser, this is similar to `HeadlessChrome/61.0.3153.0`. For non-headless or new-headless, this is similar to `Chrome/61.0.3153.0`. For Firefox, it is similar to `Firefox/116.0a1`. - -The format of browser.version() might change with future releases of browsers. diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.browser.wsendpoint.md b/website/versioned_docs/version-21.2.1/api/puppeteer.browser.wsendpoint.md deleted file mode 100644 index 4972912dbed..00000000000 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.browser.wsendpoint.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -sidebar_label: Browser.wsEndpoint ---- - -# Browser.wsEndpoint() method - -The browser websocket endpoint which can be used as an argument to [Puppeteer.connect()](./puppeteer.puppeteer.connect.md). - -#### Signature: - -```typescript -class Browser { - wsEndpoint(): string; -} -``` - -**Returns:** - -string - -The Browser websocket url. - -## Remarks - -The format is `ws://${host}:${port}/devtools/browser/`. - -You can find the `webSocketDebuggerUrl` from `http://${host}:${port}/json/version`. Learn more about the [devtools protocol](https://chromedevtools.github.io/devtools-protocol) and the [browser endpoint](https://chromedevtools.github.io/devtools-protocol/#how-do-i-access-the-browser-target). diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.browsercontext.close.md b/website/versioned_docs/version-21.2.1/api/puppeteer.browsercontext.close.md deleted file mode 100644 index a96cc587928..00000000000 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.browsercontext.close.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -sidebar_label: BrowserContext.close ---- - -# BrowserContext.close() method - -Closes the browser context. All the targets that belong to the browser context will be closed. - -#### Signature: - -```typescript -class BrowserContext { - close(): Promise; -} -``` - -**Returns:** - -Promise<void> - -## Remarks - -Only incognito browser contexts can be closed. diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.browsercontext.isincognito.md b/website/versioned_docs/version-21.2.1/api/puppeteer.browsercontext.isincognito.md deleted file mode 100644 index 38b7f39dd9e..00000000000 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.browsercontext.isincognito.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -sidebar_label: BrowserContext.isIncognito ---- - -# BrowserContext.isIncognito() method - -Returns whether BrowserContext is incognito. The default browser context is the only non-incognito browser context. - -#### Signature: - -```typescript -class BrowserContext { - isIncognito(): boolean; -} -``` - -**Returns:** - -boolean - -## Remarks - -The default browser context cannot be closed. diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.browsercontext.md b/website/versioned_docs/version-21.2.1/api/puppeteer.browsercontext.md deleted file mode 100644 index 4443ba28307..00000000000 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.browsercontext.md +++ /dev/null @@ -1,58 +0,0 @@ ---- -sidebar_label: BrowserContext ---- - -# BrowserContext class - -BrowserContexts provide a way to operate multiple independent browser sessions. When a browser is launched, it has a single BrowserContext used by default. The method [Browser.newPage](./puppeteer.browser.newpage.md) creates a page in the default browser context. - -#### Signature: - -```typescript -export declare class BrowserContext extends EventEmitter -``` - -**Extends:** [EventEmitter](./puppeteer.eventemitter.md) - -## Remarks - -The Browser class extends from Puppeteer's [EventEmitter](./puppeteer.eventemitter.md) class and will emit various events which are documented in the [BrowserContextEmittedEvents](./puppeteer.browsercontextemittedevents.md) enum. - -If a page opens another page, e.g. with a `window.open` call, the popup will belong to the parent page's browser context. - -Puppeteer allows creation of "incognito" browser contexts with [Browser.createIncognitoBrowserContext](./puppeteer.browser.createincognitobrowsercontext.md) method. "Incognito" browser contexts don't write any browsing data to disk. - -The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `BrowserContext` class. - -## Example - -```ts -// Create a new incognito browser context -const context = await browser.createIncognitoBrowserContext(); -// Create a new page inside context. -const page = await context.newPage(); -// ... do stuff with page ... -await page.goto('https://example.com'); -// Dispose context once it's no longer needed. -await context.close(); -``` - -## Properties - -| Property | Modifiers | Type | Description | -| -------- | --------------------- | ------------------- | ----------- | -| id | readonly | string \| undefined | | - -## 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-21.2.1/api/puppeteer.browsercontext.pages.md b/website/versioned_docs/version-21.2.1/api/puppeteer.browsercontext.pages.md deleted file mode 100644 index 604050d72c7..00000000000 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.browsercontext.pages.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -sidebar_label: BrowserContext.pages ---- - -# BrowserContext.pages() method - -An array of all pages inside the browser context. - -#### Signature: - -```typescript -class BrowserContext { - pages(): Promise; -} -``` - -**Returns:** - -Promise<[Page](./puppeteer.page.md)\[\]> - -Promise which resolves to an array of all open pages. Non visible pages, such as `"background_page"`, will not be listed here. You can find them using [the target page](./puppeteer.target.page.md). diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.browsercontext.waitfortarget.md b/website/versioned_docs/version-21.2.1/api/puppeteer.browsercontext.waitfortarget.md deleted file mode 100644 index dd9c3d0e724..00000000000 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.browsercontext.waitfortarget.md +++ /dev/null @@ -1,44 +0,0 @@ ---- -sidebar_label: BrowserContext.waitForTarget ---- - -# BrowserContext.waitForTarget() method - -This searches for a target in this specific browser context. - -#### Signature: - -```typescript -class BrowserContext { - waitForTarget( - predicate: (x: Target) => boolean | Promise, - options?: { - timeout?: number; - } - ): Promise; -} -``` - -## Parameters - -| Parameter | Type | Description | -| --------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| predicate | (x: [Target](./puppeteer.target.md)) => boolean \| Promise<boolean> | A function to be run for every target | -| options | { timeout?: number; } | _(Optional)_ An object of options. Accepts a timeout, which is the maximum wait time in milliseconds. Pass 0 to disable the timeout. Defaults to 30 seconds. | - -**Returns:** - -Promise<[Target](./puppeteer.target.md)> - -Promise which resolves to the first target found that matches the `predicate` function. - -## Example - -An example of finding a target for a page opened via `window.open`: - -```ts -await page.evaluate(() => window.open('https://www.example.com/')); -const newWindowTarget = await browserContext.waitForTarget( - target => target.url() === 'https://www.example.com/' -); -``` diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.commoneventemitter.addlistener.md b/website/versioned_docs/version-21.2.1/api/puppeteer.commoneventemitter.addlistener.md deleted file mode 100644 index 7e2655b7a22..00000000000 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.commoneventemitter.addlistener.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -sidebar_label: CommonEventEmitter.addListener ---- - -# CommonEventEmitter.addListener() method - -#### Signature: - -```typescript -interface CommonEventEmitter { - addListener(event: EventType, handler: Handler): this; -} -``` - -## Parameters - -| Parameter | Type | Description | -| --------- | ------------------------------------- | ----------- | -| event | [EventType](./puppeteer.eventtype.md) | | -| handler | [Handler](./puppeteer.handler.md) | | - -**Returns:** - -this diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.commoneventemitter.emit.md b/website/versioned_docs/version-21.2.1/api/puppeteer.commoneventemitter.emit.md deleted file mode 100644 index 360c130e4c0..00000000000 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.commoneventemitter.emit.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -sidebar_label: CommonEventEmitter.emit ---- - -# CommonEventEmitter.emit() method - -#### Signature: - -```typescript -interface CommonEventEmitter { - emit(event: EventType, eventData?: unknown): boolean; -} -``` - -## Parameters - -| Parameter | Type | Description | -| --------- | ------------------------------------- | ------------ | -| event | [EventType](./puppeteer.eventtype.md) | | -| eventData | unknown | _(Optional)_ | - -**Returns:** - -boolean diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.commoneventemitter.md b/website/versioned_docs/version-21.2.1/api/puppeteer.commoneventemitter.md deleted file mode 100644 index 1dca761438b..00000000000 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.commoneventemitter.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -sidebar_label: CommonEventEmitter ---- - -# CommonEventEmitter interface - -#### Signature: - -```typescript -export interface CommonEventEmitter -``` - -## Methods - -| Method | Description | -| ---------------------------------------------------------------------------------- | ----------- | -| [addListener(event, handler)](./puppeteer.commoneventemitter.addlistener.md) | | -| [emit(event, eventData)](./puppeteer.commoneventemitter.emit.md) | | -| [listenerCount(event)](./puppeteer.commoneventemitter.listenercount.md) | | -| [off(event, handler)](./puppeteer.commoneventemitter.off.md) | | -| [on(event, handler)](./puppeteer.commoneventemitter.on.md) | | -| [once(event, handler)](./puppeteer.commoneventemitter.once.md) | | -| [removeAllListeners(event)](./puppeteer.commoneventemitter.removealllisteners.md) | | -| [removeListener(event, handler)](./puppeteer.commoneventemitter.removelistener.md) | | diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.commoneventemitter.off.md b/website/versioned_docs/version-21.2.1/api/puppeteer.commoneventemitter.off.md deleted file mode 100644 index 75b80adb965..00000000000 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.commoneventemitter.off.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -sidebar_label: CommonEventEmitter.off ---- - -# CommonEventEmitter.off() method - -#### Signature: - -```typescript -interface CommonEventEmitter { - off(event: EventType, handler: Handler): this; -} -``` - -## Parameters - -| Parameter | Type | Description | -| --------- | ------------------------------------- | ----------- | -| event | [EventType](./puppeteer.eventtype.md) | | -| handler | [Handler](./puppeteer.handler.md) | | - -**Returns:** - -this diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.commoneventemitter.on.md b/website/versioned_docs/version-21.2.1/api/puppeteer.commoneventemitter.on.md deleted file mode 100644 index 2c257f84e1a..00000000000 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.commoneventemitter.on.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -sidebar_label: CommonEventEmitter.on ---- - -# CommonEventEmitter.on() method - -#### Signature: - -```typescript -interface CommonEventEmitter { - on(event: EventType, handler: Handler): this; -} -``` - -## Parameters - -| Parameter | Type | Description | -| --------- | ------------------------------------- | ----------- | -| event | [EventType](./puppeteer.eventtype.md) | | -| handler | [Handler](./puppeteer.handler.md) | | - -**Returns:** - -this diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.commoneventemitter.once.md b/website/versioned_docs/version-21.2.1/api/puppeteer.commoneventemitter.once.md deleted file mode 100644 index 73355af6f5c..00000000000 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.commoneventemitter.once.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -sidebar_label: CommonEventEmitter.once ---- - -# CommonEventEmitter.once() method - -#### Signature: - -```typescript -interface CommonEventEmitter { - once(event: EventType, handler: Handler): this; -} -``` - -## Parameters - -| Parameter | Type | Description | -| --------- | ------------------------------------- | ----------- | -| event | [EventType](./puppeteer.eventtype.md) | | -| handler | [Handler](./puppeteer.handler.md) | | - -**Returns:** - -this diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.commoneventemitter.removealllisteners.md b/website/versioned_docs/version-21.2.1/api/puppeteer.commoneventemitter.removealllisteners.md deleted file mode 100644 index 83b4cd7f34b..00000000000 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.commoneventemitter.removealllisteners.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -sidebar_label: CommonEventEmitter.removeAllListeners ---- - -# CommonEventEmitter.removeAllListeners() method - -#### Signature: - -```typescript -interface CommonEventEmitter { - removeAllListeners(event?: EventType): this; -} -``` - -## Parameters - -| Parameter | Type | Description | -| --------- | ------------------------------------- | ------------ | -| event | [EventType](./puppeteer.eventtype.md) | _(Optional)_ | - -**Returns:** - -this diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.commoneventemitter.removelistener.md b/website/versioned_docs/version-21.2.1/api/puppeteer.commoneventemitter.removelistener.md deleted file mode 100644 index 04ff12dffde..00000000000 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.commoneventemitter.removelistener.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -sidebar_label: CommonEventEmitter.removeListener ---- - -# CommonEventEmitter.removeListener() method - -#### Signature: - -```typescript -interface CommonEventEmitter { - removeListener(event: EventType, handler: Handler): this; -} -``` - -## Parameters - -| Parameter | Type | Description | -| --------- | ------------------------------------- | ----------- | -| event | [EventType](./puppeteer.eventtype.md) | | -| handler | [Handler](./puppeteer.handler.md) | | - -**Returns:** - -this diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.eventemitter.addlistener.md b/website/versioned_docs/version-21.2.1/api/puppeteer.eventemitter.addlistener.md deleted file mode 100644 index 1a53701c767..00000000000 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.eventemitter.addlistener.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -sidebar_label: EventEmitter.addListener ---- - -# EventEmitter.addListener() method - -> Warning: This API is now obsolete. -> -> please use [EventEmitter.on()](./puppeteer.eventemitter.on.md) instead. - -Add an event listener. - -#### Signature: - -```typescript -class EventEmitter { - addListener(event: EventType, handler: Handler): this; -} -``` - -## Parameters - -| Parameter | Type | Description | -| --------- | -------------------------------------------- | ----------- | -| event | [EventType](./puppeteer.eventtype.md) | | -| handler | [Handler](./puppeteer.handler.md)<any> | | - -**Returns:** - -this diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.eventemitter.emit.md b/website/versioned_docs/version-21.2.1/api/puppeteer.eventemitter.emit.md deleted file mode 100644 index 085e7b9671c..00000000000 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.eventemitter.emit.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -sidebar_label: EventEmitter.emit ---- - -# EventEmitter.emit() method - -Emit an event and call any associated listeners. - -#### Signature: - -```typescript -class EventEmitter { - emit(event: EventType, eventData?: unknown): boolean; -} -``` - -## Parameters - -| Parameter | Type | Description | -| --------- | ------------------------------------- | ------------------------------------------------------- | -| event | [EventType](./puppeteer.eventtype.md) | the event you'd like to emit | -| eventData | unknown | _(Optional)_ any data you'd like to emit with the event | - -**Returns:** - -boolean - -`true` if there are any listeners, `false` if there are not. diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.eventemitter.listenercount.md b/website/versioned_docs/version-21.2.1/api/puppeteer.eventemitter.listenercount.md deleted file mode 100644 index e1c57d37f18..00000000000 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.eventemitter.listenercount.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -sidebar_label: EventEmitter.listenerCount ---- - -# EventEmitter.listenerCount() method - -Gets the number of listeners for a given event. - -#### Signature: - -```typescript -class EventEmitter { - listenerCount(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-21.2.1/api/puppeteer.eventemitter.md b/website/versioned_docs/version-21.2.1/api/puppeteer.eventemitter.md deleted file mode 100644 index f70298fb334..00000000000 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.eventemitter.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -sidebar_label: EventEmitter ---- - -# EventEmitter class - -The EventEmitter class that many Puppeteer classes extend. - -#### Signature: - -```typescript -export declare class EventEmitter implements CommonEventEmitter -``` - -**Implements:** [CommonEventEmitter](./puppeteer.commoneventemitter.md) - -## Remarks - -This allows you to listen to events that Puppeteer classes fire and act accordingly. Therefore you'll mostly use [on](./puppeteer.eventemitter.on.md) and [off](./puppeteer.eventemitter.off.md) to bind and unbind to event listeners. - -The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `EventEmitter` class. - -## Methods - -| Method | Modifiers | Description | -| ---------------------------------------------------------------------------- | --------- | ------------------------------------------------------------------------------------------------ | -| [addListener(event, handler)](./puppeteer.eventemitter.addlistener.md) | | Add an event listener. | -| [emit(event, eventData)](./puppeteer.eventemitter.emit.md) | | Emit an event and call any associated listeners. | -| [listenerCount(event)](./puppeteer.eventemitter.listenercount.md) | | Gets the number of listeners for a given event. | -| [off(event, handler)](./puppeteer.eventemitter.off.md) | | Remove an event listener from firing. | -| [on(event, handler)](./puppeteer.eventemitter.on.md) | | Bind an event listener to fire when an event occurs. | -| [once(event, handler)](./puppeteer.eventemitter.once.md) | | Like on but the listener will only be fired once and then it will be removed. | -| [removeAllListeners(event)](./puppeteer.eventemitter.removealllisteners.md) | | Removes all listeners. If given an event argument, it will remove only listeners for that event. | -| [removeListener(event, handler)](./puppeteer.eventemitter.removelistener.md) | | Remove an event listener. | diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.eventemitter.off.md b/website/versioned_docs/version-21.2.1/api/puppeteer.eventemitter.off.md deleted file mode 100644 index 107082b191d..00000000000 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.eventemitter.off.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -sidebar_label: EventEmitter.off ---- - -# EventEmitter.off() method - -Remove an event listener from firing. - -#### Signature: - -```typescript -class EventEmitter { - off(event: EventType, handler: Handler): this; -} -``` - -## Parameters - -| Parameter | Type | Description | -| --------- | -------------------------------------------- | ----------------------------------------------- | -| event | [EventType](./puppeteer.eventtype.md) | the event type you'd like to stop listening to. | -| handler | [Handler](./puppeteer.handler.md)<any> | the function that should be removed. | - -**Returns:** - -this - -`this` to enable you to chain method calls. diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.eventemitter.on.md b/website/versioned_docs/version-21.2.1/api/puppeteer.eventemitter.on.md deleted file mode 100644 index f04ea8d5e09..00000000000 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.eventemitter.on.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -sidebar_label: EventEmitter.on ---- - -# EventEmitter.on() method - -Bind an event listener to fire when an event occurs. - -#### Signature: - -```typescript -class EventEmitter { - on(event: EventType, handler: Handler): this; -} -``` - -## 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)<any> | the function to be called when the event occurs. | - -**Returns:** - -this - -`this` to enable you to chain method calls. diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.eventemitter.once.md b/website/versioned_docs/version-21.2.1/api/puppeteer.eventemitter.once.md deleted file mode 100644 index 5d12b896064..00000000000 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.eventemitter.once.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -sidebar_label: EventEmitter.once ---- - -# EventEmitter.once() method - -Like `on` but the listener will only be fired once and then it will be removed. - -#### Signature: - -```typescript -class EventEmitter { - once(event: EventType, handler: Handler): this; -} -``` - -## Parameters - -| Parameter | Type | Description | -| --------- | -------------------------------------------- | ------------------------------------------------- | -| event | [EventType](./puppeteer.eventtype.md) | the event you'd like to listen to | -| handler | [Handler](./puppeteer.handler.md)<any> | the handler function to run when the event occurs | - -**Returns:** - -this - -`this` to enable you to chain method calls. diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.eventemitter.removealllisteners.md b/website/versioned_docs/version-21.2.1/api/puppeteer.eventemitter.removealllisteners.md deleted file mode 100644 index 1badbe777d9..00000000000 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.eventemitter.removealllisteners.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -sidebar_label: EventEmitter.removeAllListeners ---- - -# EventEmitter.removeAllListeners() method - -Removes all listeners. If given an event argument, it will remove only listeners for that event. - -#### Signature: - -```typescript -class EventEmitter { - removeAllListeners(event?: EventType): this; -} -``` - -## Parameters - -| Parameter | Type | Description | -| --------- | ------------------------------------- | ----------------------------------------------- | -| event | [EventType](./puppeteer.eventtype.md) | _(Optional)_ the event to remove listeners for. | - -**Returns:** - -this - -`this` to enable you to chain method calls. diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.eventemitter.removelistener.md b/website/versioned_docs/version-21.2.1/api/puppeteer.eventemitter.removelistener.md deleted file mode 100644 index 72e5ac7bd99..00000000000 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.eventemitter.removelistener.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -sidebar_label: EventEmitter.removeListener ---- - -# EventEmitter.removeListener() method - -> Warning: This API is now obsolete. -> -> please use [EventEmitter.off()](./puppeteer.eventemitter.off.md) instead. - -Remove an event listener. - -#### Signature: - -```typescript -class EventEmitter { - removeListener(event: EventType, handler: Handler): this; -} -``` - -## Parameters - -| Parameter | Type | Description | -| --------- | -------------------------------------------- | ----------- | -| event | [EventType](./puppeteer.eventtype.md) | | -| handler | [Handler](./puppeteer.handler.md)<any> | | - -**Returns:** - -this diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.eventtype.md b/website/versioned_docs/version-21.2.1/api/puppeteer.eventtype.md deleted file mode 100644 index db529a6ae90..00000000000 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.eventtype.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -sidebar_label: EventType ---- - -# EventType type - -#### Signature: - -```typescript -export type EventType = string | symbol; -``` diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.frame.waitfornavigation.md b/website/versioned_docs/version-21.2.1/api/puppeteer.frame.waitfornavigation.md deleted file mode 100644 index d8f96604c5d..00000000000 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.frame.waitfornavigation.md +++ /dev/null @@ -1,43 +0,0 @@ ---- -sidebar_label: Frame.waitForNavigation ---- - -# Frame.waitForNavigation() method - -Waits for the frame to navigate. It is useful for when you run code which will indirectly cause the frame to navigate. - -Usage of the [History API](https://developer.mozilla.org/en-US/docs/Web/API/History_API) to change the URL is considered a navigation. - -#### Signature: - -```typescript -class Frame { - abstract waitForNavigation(options?: { - timeout?: number; - waitUntil?: PuppeteerLifeCycleEvent | PuppeteerLifeCycleEvent[]; - }): Promise; -} -``` - -## Parameters - -| Parameter | Type | Description | -| --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- | -| options | { timeout?: number; waitUntil?: [PuppeteerLifeCycleEvent](./puppeteer.puppeteerlifecycleevent.md) \| [PuppeteerLifeCycleEvent](./puppeteer.puppeteerlifecycleevent.md)\[\]; } | _(Optional)_ options to configure when the navigation is consided finished. | - -**Returns:** - -Promise<[HTTPResponse](./puppeteer.httpresponse.md) \| null> - -a promise that resolves when the frame navigates to a new URL. - -## Example - -```ts -const [response] = await Promise.all([ - // The navigation promise resolves after navigation has finished - frame.waitForNavigation(), - // Clicking the link will indirectly cause a navigation - frame.click('a.my-link'), -]); -``` diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.jshandle._symbol.asyncdispose_.md b/website/versioned_docs/version-21.2.1/api/puppeteer.jshandle._symbol.asyncdispose_.md deleted file mode 100644 index 4d64d626f21..00000000000 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.jshandle._symbol.asyncdispose_.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -sidebar_label: JSHandle.[Symbol.asyncDispose] ---- - -# JSHandle.\[Symbol.asyncDispose\]() method - -#### Signature: - -```typescript -class JSHandle { - [Symbol.asyncDispose](): Promise; -} -``` - -**Returns:** - -Promise<void> diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.jshandle._symbol.dispose_.md b/website/versioned_docs/version-21.2.1/api/puppeteer.jshandle._symbol.dispose_.md deleted file mode 100644 index 33aac4207d9..00000000000 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.jshandle._symbol.dispose_.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -sidebar_label: JSHandle.[Symbol.dispose] ---- - -# JSHandle.\[Symbol.dispose\]() method - -#### Signature: - -```typescript -class JSHandle { - [Symbol.dispose](): void; -} -``` - -**Returns:** - -void diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.locator.off.md b/website/versioned_docs/version-21.2.1/api/puppeteer.locator.off.md deleted file mode 100644 index 94d8ff142e6..00000000000 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.locator.off.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -sidebar_label: Locator.off ---- - -# Locator.off() method - -#### Signature: - -```typescript -class Locator { - off( - eventName: K, - handler: (event: LocatorEventObject[K]) => void - ): this; -} -``` - -## Parameters - -| Parameter | Type | Description | -| --------- | -------------------------------------------------------------------------------- | ----------- | -| eventName | K | | -| handler | (event: [LocatorEventObject](./puppeteer.locatoreventobject.md)\[K\]) => void | | - -**Returns:** - -this diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.locator.on.md b/website/versioned_docs/version-21.2.1/api/puppeteer.locator.on.md deleted file mode 100644 index 487e21412cb..00000000000 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.locator.on.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -sidebar_label: Locator.on ---- - -# Locator.on() method - -#### Signature: - -```typescript -class Locator { - on( - eventName: K, - handler: (event: LocatorEventObject[K]) => void - ): this; -} -``` - -## Parameters - -| Parameter | Type | Description | -| --------- | -------------------------------------------------------------------------------- | ----------- | -| eventName | K | | -| handler | (event: [LocatorEventObject](./puppeteer.locatoreventobject.md)\[K\]) => void | | - -**Returns:** - -this diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.locator.once.md b/website/versioned_docs/version-21.2.1/api/puppeteer.locator.once.md deleted file mode 100644 index 54037d294c2..00000000000 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.locator.once.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -sidebar_label: Locator.once ---- - -# Locator.once() method - -#### Signature: - -```typescript -class Locator { - once( - eventName: K, - handler: (event: LocatorEventObject[K]) => void - ): this; -} -``` - -## Parameters - -| Parameter | Type | Description | -| --------- | -------------------------------------------------------------------------------- | ----------- | -| eventName | K | | -| handler | (event: [LocatorEventObject](./puppeteer.locatoreventobject.md)\[K\]) => void | | - -**Returns:** - -this diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.locatoreventobject.md b/website/versioned_docs/version-21.2.1/api/puppeteer.locatoreventobject.md deleted file mode 100644 index 8b70ec2a8b9..00000000000 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.locatoreventobject.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -sidebar_label: LocatorEventObject ---- - -# LocatorEventObject interface - -#### Signature: - -```typescript -export interface LocatorEventObject -``` - -## Properties - -| Property | Modifiers | Type | Description | Default | -| -------- | --------- | ----- | ----------- | ------- | -| action | | never | | | diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.page._symbol.asyncdispose_.md b/website/versioned_docs/version-21.2.1/api/puppeteer.page._symbol.asyncdispose_.md deleted file mode 100644 index 578344b23c0..00000000000 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.page._symbol.asyncdispose_.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -sidebar_label: Page.[Symbol.asyncDispose] ---- - -# Page.\[Symbol.asyncDispose\]() method - -#### Signature: - -```typescript -class Page { - [Symbol.asyncDispose](): Promise; -} -``` - -**Returns:** - -Promise<void> diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.page._symbol.dispose_.md b/website/versioned_docs/version-21.2.1/api/puppeteer.page._symbol.dispose_.md deleted file mode 100644 index f1bfc8123e5..00000000000 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.page._symbol.dispose_.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -sidebar_label: Page.[Symbol.dispose] ---- - -# Page.\[Symbol.dispose\]() method - -#### Signature: - -```typescript -class Page { - [Symbol.dispose](): void; -} -``` - -**Returns:** - -void diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.page.goto.md b/website/versioned_docs/version-21.2.1/api/puppeteer.page.goto.md deleted file mode 100644 index f75be4f13c3..00000000000 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.page.goto.md +++ /dev/null @@ -1,54 +0,0 @@ ---- -sidebar_label: Page.goto ---- - -# Page.goto() method - -#### Signature: - -```typescript -class Page { - goto( - url: string, - options?: WaitForOptions & { - referer?: string; - referrerPolicy?: string; - } - ): Promise; -} -``` - -## Parameters - -| Parameter | Type | Description | -| --------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | -| url | string | URL to navigate page to. The URL should include scheme, e.g. https:// | -| options | [WaitForOptions](./puppeteer.waitforoptions.md) & { referer?: string; referrerPolicy?: string; } | _(Optional)_ Navigation Parameter | - -**Returns:** - -Promise<[HTTPResponse](./puppeteer.httpresponse.md) \| null> - -Promise which resolves to the main resource response. In case of multiple redirects, the navigation will resolve with the response of the last redirect. - -## Remarks - -The argument `options` might have the following properties: - -- `timeout` : Maximum navigation time in milliseconds, defaults to 30 seconds, pass 0 to disable timeout. The default value can be changed by using the [Page.setDefaultNavigationTimeout()](./puppeteer.page.setdefaultnavigationtimeout.md) or [Page.setDefaultTimeout()](./puppeteer.page.setdefaulttimeout.md) methods. - -- `waitUntil`:When to consider navigation succeeded, defaults to `load`. Given an array of event strings, navigation is considered to be successful after all events have been fired. Events can be either:
- `load` : consider navigation to be finished when the load event is fired.
- `domcontentloaded` : consider navigation to be finished when the DOMContentLoaded event is fired.
- `networkidle0` : consider navigation to be finished when there are no more than 0 network connections for at least `500` ms.
- `networkidle2` : consider navigation to be finished when there are no more than 2 network connections for at least `500` ms. - -- `referer` : Referer header value. If provided it will take preference over the referer header value set by [page.setExtraHTTPHeaders()](./puppeteer.page.setextrahttpheaders.md).
- `referrerPolicy` : ReferrerPolicy. If provided it will take preference over the referer-policy header value set by [page.setExtraHTTPHeaders()](./puppeteer.page.setextrahttpheaders.md). - -`page.goto` will throw an error if: - -- there's an SSL error (e.g. in case of self-signed certificates). - target URL is invalid. - the timeout is exceeded during navigation. - the remote server does not respond or is unreachable. - the main resource failed to load. - -`page.goto` will not throw an error when any valid HTTP status code is returned by the remote server, including 404 "Not Found" and 500 "Internal Server Error". The status code for such responses can be retrieved by calling response.status(). - -NOTE: `page.goto` either throws an error or returns a main resource response. The only exceptions are navigation to about:blank or navigation to the same URL with a different hash, which would succeed and return null. - -NOTE: Headless mode doesn't support navigation to a PDF document. See the [upstream issue](https://bugs.chromium.org/p/chromium/issues/detail?id=761295). - -Shortcut for [page.mainFrame().goto(url, options)](./puppeteer.frame.goto.md). diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.page.off.md b/website/versioned_docs/version-21.2.1/api/puppeteer.page.off.md deleted file mode 100644 index dadfa5968f5..00000000000 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.page.off.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -sidebar_label: Page.off ---- - -# Page.off() method - -#### Signature: - -```typescript -class Page { - off( - eventName: K, - handler: (event: PageEventObject[K]) => void - ): this; -} -``` - -## Parameters - -| Parameter | Type | Description | -| --------- | -------------------------------------------------------------------------- | ----------- | -| eventName | K | | -| handler | (event: [PageEventObject](./puppeteer.pageeventobject.md)\[K\]) => void | | - -**Returns:** - -this diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.page.on.md b/website/versioned_docs/version-21.2.1/api/puppeteer.page.on.md deleted file mode 100644 index c2c8da12ad7..00000000000 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.page.on.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -sidebar_label: Page.on ---- - -# Page.on() method - -Listen to page events. - -:::note - -This method exists to define event typings and handle proper wireup of cooperative request interception. Actual event listening and dispatching is delegated to [EventEmitter](./puppeteer.eventemitter.md). - -::: - -#### Signature: - -```typescript -class Page { - on( - eventName: K, - handler: (event: PageEventObject[K]) => void - ): this; -} -``` - -## Parameters - -| Parameter | Type | Description | -| --------- | -------------------------------------------------------------------------- | ----------- | -| eventName | K | | -| handler | (event: [PageEventObject](./puppeteer.pageeventobject.md)\[K\]) => void | | - -**Returns:** - -this diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.page.once.md b/website/versioned_docs/version-21.2.1/api/puppeteer.page.once.md deleted file mode 100644 index 3cdb2079a67..00000000000 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.page.once.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -sidebar_label: Page.once ---- - -# Page.once() method - -#### Signature: - -```typescript -class Page { - once( - eventName: K, - handler: (event: PageEventObject[K]) => void - ): this; -} -``` - -## Parameters - -| Parameter | Type | Description | -| --------- | -------------------------------------------------------------------------- | ----------- | -| eventName | K | | -| handler | (event: [PageEventObject](./puppeteer.pageeventobject.md)\[K\]) => void | | - -**Returns:** - -this diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.page.reload.md b/website/versioned_docs/version-21.2.1/api/puppeteer.page.reload.md deleted file mode 100644 index f483a097aef..00000000000 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.page.reload.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -sidebar_label: Page.reload ---- - -# Page.reload() method - -#### Signature: - -```typescript -class Page { - reload(options?: WaitForOptions): Promise; -} -``` - -## Parameters - -| Parameter | Type | Description | -| --------- | ----------------------------------------------- | ----------------------------------------------------------------------------- | -| options | [WaitForOptions](./puppeteer.waitforoptions.md) | _(Optional)_ Navigation parameters which might have the following properties: | - -**Returns:** - -Promise<[HTTPResponse](./puppeteer.httpresponse.md) \| null> - -Promise which resolves to the main resource response. In case of multiple redirects, the navigation will resolve with the response of the last redirect. - -## Remarks - -The argument `options` might have the following properties: - -- `timeout` : Maximum navigation time in milliseconds, defaults to 30 seconds, pass 0 to disable timeout. The default value can be changed by using the [Page.setDefaultNavigationTimeout()](./puppeteer.page.setdefaultnavigationtimeout.md) or [Page.setDefaultTimeout()](./puppeteer.page.setdefaulttimeout.md) methods. - -- `waitUntil`: When to consider navigation succeeded, defaults to `load`. Given an array of event strings, navigation is considered to be successful after all events have been fired. Events can be either:
- `load` : consider navigation to be finished when the load event is fired.
- `domcontentloaded` : consider navigation to be finished when the DOMContentLoaded event is fired.
- `networkidle0` : consider navigation to be finished when there are no more than 0 network connections for at least `500` ms.
- `networkidle2` : consider navigation to be finished when there are no more than 2 network connections for at least `500` ms. diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.puppeteerlifecycleevent.md b/website/versioned_docs/version-21.2.1/api/puppeteer.puppeteerlifecycleevent.md deleted file mode 100644 index 012b9cf9b33..00000000000 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.puppeteerlifecycleevent.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -sidebar_label: PuppeteerLifeCycleEvent ---- - -# PuppeteerLifeCycleEvent type - -#### Signature: - -```typescript -export type PuppeteerLifeCycleEvent = - | 'load' - | 'domcontentloaded' - | 'networkidle0' - | 'networkidle2'; -``` diff --git a/website/versioned_docs/version-21.2.1/api/index.md b/website/versioned_docs/version-21.3.0/api/index.md similarity index 87% rename from website/versioned_docs/version-21.2.1/api/index.md rename to website/versioned_docs/version-21.3.0/api/index.md index b3aa0bd6802..2fd071718a1 100644 --- a/website/versioned_docs/version-21.2.1/api/index.md +++ b/website/versioned_docs/version-21.3.0/api/index.md @@ -6,53 +6,53 @@ sidebar_label: API ## Classes -| Class | Description | -| --------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [Accessibility](./puppeteer.accessibility.md) | The Accessibility class provides methods for inspecting the browser's accessibility tree. The accessibility tree is used by assistive technology such as [screen readers](https://en.wikipedia.org/wiki/Screen_reader) or [switches](https://en.wikipedia.org/wiki/Switch_access). | -| [Browser](./puppeteer.browser.md) | A Browser is created when Puppeteer connects to a browser instance, either through [PuppeteerNode.launch()](./puppeteer.puppeteernode.launch.md) or [Puppeteer.connect()](./puppeteer.puppeteer.connect.md). | -| [BrowserContext](./puppeteer.browsercontext.md) | BrowserContexts provide a way to operate multiple independent browser sessions. When a browser is launched, it has a single BrowserContext used by default. The method [Browser.newPage](./puppeteer.browser.newpage.md) creates a page in the default browser context. | -| [CDPSession](./puppeteer.cdpsession.md) | The CDPSession instances are used to talk raw Chrome Devtools Protocol. | -| [Connection](./puppeteer.connection.md) | | -| [ConsoleMessage](./puppeteer.consolemessage.md) | ConsoleMessage objects are dispatched by page via the 'console' event. | -| [Coverage](./puppeteer.coverage.md) | The Coverage class provides methods to gather information about parts of JavaScript and CSS that were used by the page. | -| [CSSCoverage](./puppeteer.csscoverage.md) | | -| [CustomError](./puppeteer.customerror.md) | | -| [DeviceRequestPrompt](./puppeteer.devicerequestprompt.md) | Device request prompts let you respond to the page requesting for a device through an API like WebBluetooth. | -| [DeviceRequestPromptDevice](./puppeteer.devicerequestpromptdevice.md) | Device in a request prompt. | -| [Dialog](./puppeteer.dialog.md) | Dialog instances are dispatched by the [Page](./puppeteer.page.md) via the dialog event. | -| [ElementHandle](./puppeteer.elementhandle.md) | ElementHandle represents an in-page DOM element. | -| [EventEmitter](./puppeteer.eventemitter.md) | The EventEmitter class that many Puppeteer classes extend. | -| [FileChooser](./puppeteer.filechooser.md) | File choosers let you react to the page requesting for a file. | -| [Frame](./puppeteer.frame.md) |

Represents a DOM frame.

To understand frames, you can think of frames as <iframe> elements. Just like iframes, frames can be nested, and when JavaScript is executed in a frame, the JavaScript does not effect frames inside the ambient frame the JavaScript executes in.

| -| [HTTPRequest](./puppeteer.httprequest.md) | Represents an HTTP request sent by a page. | -| [HTTPResponse](./puppeteer.httpresponse.md) | The HTTPResponse class represents responses which are received by the [Page](./puppeteer.page.md) class. | -| [JSCoverage](./puppeteer.jscoverage.md) | | -| [JSHandle](./puppeteer.jshandle.md) |

Represents a reference to a JavaScript object. Instances can be created using [Page.evaluateHandle()](./puppeteer.page.evaluatehandle.md).

Handles prevent the referenced JavaScript object from being garbage-collected unless the handle is purposely [disposed](./puppeteer.jshandle.dispose.md). JSHandles are auto-disposed when their associated frame is navigated away or the parent context gets destroyed.

Handles can be used as arguments for any evaluation function such as [Page.$eval()](./puppeteer.page._eval.md), [Page.evaluate()](./puppeteer.page.evaluate.md), and [Page.evaluateHandle()](./puppeteer.page.evaluatehandle.md). They are resolved to their referenced object.

| -| [Keyboard](./puppeteer.keyboard.md) | Keyboard provides an api for managing a virtual keyboard. The high level api is [Keyboard.type()](./puppeteer.keyboard.type.md), which takes raw characters and generates proper keydown, keypress/input, and keyup events on your page. | -| [Locator](./puppeteer.locator.md) | Locators describe a strategy of locating objects and performing an action on them. If the action fails because the object is not ready for the action, the whole operation is retried. Various preconditions for a successful action are checked automatically. | -| [Mouse](./puppeteer.mouse.md) | The Mouse class operates in main-frame CSS pixels relative to the top-left corner of the viewport. | -| [Page](./puppeteer.page.md) |

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

:::note

One Browser instance might have multiple Page instances.

:::

| -| [ProductLauncher](./puppeteer.productlauncher.md) | Describes a launcher - a class that is able to create and launch a browser instance. | -| [ProtocolError](./puppeteer.protocolerror.md) | ProtocolError is emitted whenever there is an error from the protocol. | -| [Puppeteer](./puppeteer.puppeteer.md) |

The main Puppeteer class.

IMPORTANT: if you are using Puppeteer in a Node environment, you will get an instance of [PuppeteerNode](./puppeteer.puppeteernode.md) when you import or require puppeteer. That class extends Puppeteer, so has all the methods documented below as well as all that are defined on [PuppeteerNode](./puppeteer.puppeteernode.md).

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

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

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

| -| [SecurityDetails](./puppeteer.securitydetails.md) | The SecurityDetails class represents the security details of a response that was received over a secure connection. | -| [Target](./puppeteer.target.md) | Target represents a [CDP target](https://chromedevtools.github.io/devtools-protocol/tot/Target/). In CDP a target is something that can be debugged such a frame, a page or a worker. | -| [TimeoutError](./puppeteer.timeouterror.md) | TimeoutError is emitted whenever certain operations are terminated due to timeout. | -| [Touchscreen](./puppeteer.touchscreen.md) | The Touchscreen class exposes touchscreen events. | -| [Tracing](./puppeteer.tracing.md) | The Tracing class exposes the tracing audit interface. | -| [WebWorker](./puppeteer.webworker.md) | This class represents a [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API). | +| Class | Description | +| --------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [Accessibility](./puppeteer.accessibility.md) | The Accessibility class provides methods for inspecting the browser's accessibility tree. The accessibility tree is used by assistive technology such as [screen readers](https://en.wikipedia.org/wiki/Screen_reader) or [switches](https://en.wikipedia.org/wiki/Switch_access). | +| [Browser](./puppeteer.browser.md) |

[Browser](./puppeteer.browser.md) represents a browser instance that is either:

- connected to via [Puppeteer.connect()](./puppeteer.puppeteer.connect.md) or - launched by [PuppeteerNode.launch()](./puppeteer.puppeteernode.launch.md).

[Browser](./puppeteer.browser.md) [emits](./puppeteer.eventemitter.md) various events which are documented in the [BrowserEvent](./puppeteer.browserevent.md) enum.

| +| [BrowserContext](./puppeteer.browsercontext.md) |

[BrowserContext](./puppeteer.browsercontext.md) represents individual sessions within a [browser](./puppeteer.browser.md).

When a [browser](./puppeteer.browser.md) is launched, it has a single [browser context](./puppeteer.browsercontext.md) by default. Others can be created using [Browser.createIncognitoBrowserContext()](./puppeteer.browser.createincognitobrowsercontext.md).

[BrowserContext](./puppeteer.browsercontext.md) [emits](./puppeteer.eventemitter.md) various events which are documented in the [BrowserContextEvent](./puppeteer.browsercontextevent.md) enum.

If a [page](./puppeteer.page.md) opens another [page](./puppeteer.page.md), e.g. using window.open, the popup will belong to the parent [page's browser context](./puppeteer.page.browsercontext.md).

| +| [CDPSession](./puppeteer.cdpsession.md) | The CDPSession instances are used to talk raw Chrome Devtools Protocol. | +| [Connection](./puppeteer.connection.md) | | +| [ConsoleMessage](./puppeteer.consolemessage.md) | ConsoleMessage objects are dispatched by page via the 'console' event. | +| [Coverage](./puppeteer.coverage.md) | The Coverage class provides methods to gather information about parts of JavaScript and CSS that were used by the page. | +| [CSSCoverage](./puppeteer.csscoverage.md) | | +| [CustomError](./puppeteer.customerror.md) | | +| [DeviceRequestPrompt](./puppeteer.devicerequestprompt.md) | Device request prompts let you respond to the page requesting for a device through an API like WebBluetooth. | +| [DeviceRequestPromptDevice](./puppeteer.devicerequestpromptdevice.md) | Device in a request prompt. | +| [Dialog](./puppeteer.dialog.md) | Dialog instances are dispatched by the [Page](./puppeteer.page.md) via the dialog event. | +| [ElementHandle](./puppeteer.elementhandle.md) | ElementHandle represents an in-page DOM element. | +| [EventEmitter](./puppeteer.eventemitter.md) | The EventEmitter class that many Puppeteer classes extend. | +| [FileChooser](./puppeteer.filechooser.md) | File choosers let you react to the page requesting for a file. | +| [Frame](./puppeteer.frame.md) |

Represents a DOM frame.

To understand frames, you can think of frames as <iframe> elements. Just like iframes, frames can be nested, and when JavaScript is executed in a frame, the JavaScript does not effect frames inside the ambient frame the JavaScript executes in.

| +| [HTTPRequest](./puppeteer.httprequest.md) | Represents an HTTP request sent by a page. | +| [HTTPResponse](./puppeteer.httpresponse.md) | The HTTPResponse class represents responses which are received by the [Page](./puppeteer.page.md) class. | +| [JSCoverage](./puppeteer.jscoverage.md) | | +| [JSHandle](./puppeteer.jshandle.md) |

Represents a reference to a JavaScript object. Instances can be created using [Page.evaluateHandle()](./puppeteer.page.evaluatehandle.md).

Handles prevent the referenced JavaScript object from being garbage-collected unless the handle is purposely [disposed](./puppeteer.jshandle.dispose.md). JSHandles are auto-disposed when their associated frame is navigated away or the parent context gets destroyed.

Handles can be used as arguments for any evaluation function such as [Page.$eval()](./puppeteer.page._eval.md), [Page.evaluate()](./puppeteer.page.evaluate.md), and [Page.evaluateHandle()](./puppeteer.page.evaluatehandle.md). They are resolved to their referenced object.

| +| [Keyboard](./puppeteer.keyboard.md) | Keyboard provides an api for managing a virtual keyboard. The high level api is [Keyboard.type()](./puppeteer.keyboard.type.md), which takes raw characters and generates proper keydown, keypress/input, and keyup events on your page. | +| [Locator](./puppeteer.locator.md) | Locators describe a strategy of locating objects and performing an action on them. If the action fails because the object is not ready for the action, the whole operation is retried. Various preconditions for a successful action are checked automatically. | +| [Mouse](./puppeteer.mouse.md) | The Mouse class operates in main-frame CSS pixels relative to the top-left corner of the viewport. | +| [Page](./puppeteer.page.md) |

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

:::note

One Browser instance might have multiple Page instances.

:::

| +| [ProductLauncher](./puppeteer.productlauncher.md) | Describes a launcher - a class that is able to create and launch a browser instance. | +| [ProtocolError](./puppeteer.protocolerror.md) | ProtocolError is emitted whenever there is an error from the protocol. | +| [Puppeteer](./puppeteer.puppeteer.md) |

The main Puppeteer class.

IMPORTANT: if you are using Puppeteer in a Node environment, you will get an instance of [PuppeteerNode](./puppeteer.puppeteernode.md) when you import or require puppeteer. That class extends Puppeteer, so has all the methods documented below as well as all that are defined on [PuppeteerNode](./puppeteer.puppeteernode.md).

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

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

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

| +| [SecurityDetails](./puppeteer.securitydetails.md) | The SecurityDetails class represents the security details of a response that was received over a secure connection. | +| [Target](./puppeteer.target.md) | Target represents a [CDP target](https://chromedevtools.github.io/devtools-protocol/tot/Target/). In CDP a target is something that can be debugged such a frame, a page or a worker. | +| [TimeoutError](./puppeteer.timeouterror.md) | TimeoutError is emitted whenever certain operations are terminated due to timeout. | +| [Touchscreen](./puppeteer.touchscreen.md) | The Touchscreen class exposes touchscreen events. | +| [Tracing](./puppeteer.tracing.md) | The Tracing class exposes the tracing audit interface. | +| [WebWorker](./puppeteer.webworker.md) | This class represents a [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API). | ## Enumerations -| Enumeration | Description | -| ------------------------------------------------------------------------- | --------------------------------------------------------------------- | -| [BrowserContextEmittedEvents](./puppeteer.browsercontextemittedevents.md) | | -| [BrowserEmittedEvents](./puppeteer.browseremittedevents.md) | All the events a [browser instance](./puppeteer.browser.md) may emit. | -| [InterceptResolutionAction](./puppeteer.interceptresolutionaction.md) | | -| [LocatorEmittedEvents](./puppeteer.locatoremittedevents.md) | All the events that a locator instance may emit. | -| [PageEmittedEvents](./puppeteer.pageemittedevents.md) | All the events that a page instance may emit. | -| [TargetType](./puppeteer.targettype.md) | | +| Enumeration | Description | +| --------------------------------------------------------------------- | --------------------------------------------------------------------- | +| [BrowserContextEvent](./puppeteer.browsercontextevent.md) | | +| [BrowserEvent](./puppeteer.browserevent.md) | All the events a [browser instance](./puppeteer.browser.md) may emit. | +| [InterceptResolutionAction](./puppeteer.interceptresolutionaction.md) | | +| [LocatorEvent](./puppeteer.locatorevent.md) | All the events that a locator instance may emit. | +| [PageEvent](./puppeteer.pageevent.md) | All the events that a page instance may emit. | +| [TargetType](./puppeteer.targettype.md) | | ## Functions @@ -65,69 +65,74 @@ sidebar_label: API ## Interfaces -| Interface | Description | -| --------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [ActionOptions](./puppeteer.actionoptions.md) | | -| [AutofillData](./puppeteer.autofilldata.md) | | -| [BoundingBox](./puppeteer.boundingbox.md) | | -| [BoxModel](./puppeteer.boxmodel.md) | | -| [BrowserConnectOptions](./puppeteer.browserconnectoptions.md) | Generic browser options that can be passed when launching any browser or when connecting to an existing browser instance. | -| [BrowserContextOptions](./puppeteer.browsercontextoptions.md) | BrowserContext options. | -| [BrowserLaunchArgumentOptions](./puppeteer.browserlaunchargumentoptions.md) | Launcher options that only apply to Chrome. | -| [ClickOptions](./puppeteer.clickoptions.md) | | -| [CommonEventEmitter](./puppeteer.commoneventemitter.md) | | -| [Configuration](./puppeteer.configuration.md) |

Defines options to configure Puppeteer's behavior during installation and runtime.

See individual properties for more information.

| -| [ConnectionTransport](./puppeteer.connectiontransport.md) | | -| [ConnectOptions](./puppeteer.connectoptions.md) | | -| [ConsoleMessageLocation](./puppeteer.consolemessagelocation.md) | | -| [ContinueRequestOverrides](./puppeteer.continuerequestoverrides.md) | | -| [CoverageEntry](./puppeteer.coverageentry.md) | The CoverageEntry class represents one entry of the coverage report. | -| [Credentials](./puppeteer.credentials.md) | | -| [CSSCoverageOptions](./puppeteer.csscoverageoptions.md) | Set of configurable options for CSS coverage. | -| [CustomQueryHandler](./puppeteer.customqueryhandler.md) | | -| [Device](./puppeteer.device.md) | | -| [FrameAddScriptTagOptions](./puppeteer.frameaddscripttagoptions.md) | | -| [FrameAddStyleTagOptions](./puppeteer.frameaddstyletagoptions.md) | | -| [FrameWaitForFunctionOptions](./puppeteer.framewaitforfunctionoptions.md) | | -| [GeolocationOptions](./puppeteer.geolocationoptions.md) | | -| [InterceptResolutionState](./puppeteer.interceptresolutionstate.md) | | -| [InternalNetworkConditions](./puppeteer.internalnetworkconditions.md) | | -| [JSCoverageEntry](./puppeteer.jscoverageentry.md) | The CoverageEntry class for JavaScript | -| [JSCoverageOptions](./puppeteer.jscoverageoptions.md) | Set of configurable options for JS coverage. | -| [KeyboardTypeOptions](./puppeteer.keyboardtypeoptions.md) | | -| [KeyDownOptions](./puppeteer.keydownoptions.md) | | -| [LaunchOptions](./puppeteer.launchoptions.md) | Generic launch options that can be passed when launching any browser. | -| [LocatorEventObject](./puppeteer.locatoreventobject.md) | | -| [LocatorOptions](./puppeteer.locatoroptions.md) | | -| [LocatorScrollOptions](./puppeteer.locatorscrolloptions.md) | | -| [MediaFeature](./puppeteer.mediafeature.md) | | -| [Metrics](./puppeteer.metrics.md) | | -| [MouseClickOptions](./puppeteer.mouseclickoptions.md) | | -| [MouseMoveOptions](./puppeteer.mousemoveoptions.md) | | -| [MouseOptions](./puppeteer.mouseoptions.md) | | -| [MouseWheelOptions](./puppeteer.mousewheeloptions.md) | | -| [Moveable](./puppeteer.moveable.md) | | -| [NetworkConditions](./puppeteer.networkconditions.md) | | -| [NewDocumentScriptEvaluation](./puppeteer.newdocumentscriptevaluation.md) | | -| [Offset](./puppeteer.offset.md) | | -| [PageEventObject](./puppeteer.pageeventobject.md) |

Denotes the objects received by callback functions for page events.

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

| -| [PDFMargin](./puppeteer.pdfmargin.md) | | -| [PDFOptions](./puppeteer.pdfoptions.md) | Valid options to configure PDF generation via [Page.pdf()](./puppeteer.page.pdf.md). | -| [Point](./puppeteer.point.md) | | -| [PuppeteerErrors](./puppeteer.puppeteererrors.md) | | -| [PuppeteerLaunchOptions](./puppeteer.puppeteerlaunchoptions.md) | | -| [RemoteAddress](./puppeteer.remoteaddress.md) | | -| [ResponseForRequest](./puppeteer.responseforrequest.md) | Required response data to fulfill a request with. | -| [ScreenshotClip](./puppeteer.screenshotclip.md) | | -| [ScreenshotOptions](./puppeteer.screenshotoptions.md) | | -| [SerializedAXNode](./puppeteer.serializedaxnode.md) | Represents a Node and the properties of it that are relevant to Accessibility. | -| [SnapshotOptions](./puppeteer.snapshotoptions.md) | | -| [TracingOptions](./puppeteer.tracingoptions.md) | | -| [Viewport](./puppeteer.viewport.md) | Sets the viewport of the page. | -| [WaitForOptions](./puppeteer.waitforoptions.md) | | -| [WaitForSelectorOptions](./puppeteer.waitforselectoroptions.md) | | -| [WaitForTargetOptions](./puppeteer.waitfortargetoptions.md) | | -| [WaitTimeoutOptions](./puppeteer.waittimeoutoptions.md) | | +| Interface | Description | +| --------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [ActionOptions](./puppeteer.actionoptions.md) | | +| [AutofillData](./puppeteer.autofilldata.md) | | +| [BoundingBox](./puppeteer.boundingbox.md) | | +| [BoxModel](./puppeteer.boxmodel.md) | | +| [BrowserConnectOptions](./puppeteer.browserconnectoptions.md) | Generic browser options that can be passed when launching any browser or when connecting to an existing browser instance. | +| [BrowserContextEvents](./puppeteer.browsercontextevents.md) | | +| [BrowserContextOptions](./puppeteer.browsercontextoptions.md) | | +| [BrowserEvents](./puppeteer.browserevents.md) | | +| [BrowserLaunchArgumentOptions](./puppeteer.browserlaunchargumentoptions.md) | Launcher options that only apply to Chrome. | +| [CDPSessionEvents](./puppeteer.cdpsessionevents.md) | | +| [ClickOptions](./puppeteer.clickoptions.md) | | +| [CommonEventEmitter](./puppeteer.commoneventemitter.md) | | +| [Configuration](./puppeteer.configuration.md) |

Defines options to configure Puppeteer's behavior during installation and runtime.

See individual properties for more information.

| +| [ConnectionTransport](./puppeteer.connectiontransport.md) | | +| [ConnectOptions](./puppeteer.connectoptions.md) | | +| [ConsoleMessageLocation](./puppeteer.consolemessagelocation.md) | | +| [ContinueRequestOverrides](./puppeteer.continuerequestoverrides.md) | | +| [CoverageEntry](./puppeteer.coverageentry.md) | The CoverageEntry class represents one entry of the coverage report. | +| [Credentials](./puppeteer.credentials.md) | | +| [CSSCoverageOptions](./puppeteer.csscoverageoptions.md) | Set of configurable options for CSS coverage. | +| [CustomQueryHandler](./puppeteer.customqueryhandler.md) | | +| [Device](./puppeteer.device.md) | | +| [FrameAddScriptTagOptions](./puppeteer.frameaddscripttagoptions.md) | | +| [FrameAddStyleTagOptions](./puppeteer.frameaddstyletagoptions.md) | | +| [FrameEvents](./puppeteer.frameevents.md) | | +| [FrameWaitForFunctionOptions](./puppeteer.framewaitforfunctionoptions.md) | | +| [GeolocationOptions](./puppeteer.geolocationoptions.md) | | +| [GoToOptions](./puppeteer.gotooptions.md) | | +| [InterceptResolutionState](./puppeteer.interceptresolutionstate.md) | | +| [InternalNetworkConditions](./puppeteer.internalnetworkconditions.md) | | +| [JSCoverageEntry](./puppeteer.jscoverageentry.md) | The CoverageEntry class for JavaScript | +| [JSCoverageOptions](./puppeteer.jscoverageoptions.md) | Set of configurable options for JS coverage. | +| [KeyboardTypeOptions](./puppeteer.keyboardtypeoptions.md) | | +| [KeyDownOptions](./puppeteer.keydownoptions.md) | | +| [LaunchOptions](./puppeteer.launchoptions.md) | Generic launch options that can be passed when launching any browser. | +| [LocatorEvents](./puppeteer.locatorevents.md) | | +| [LocatorOptions](./puppeteer.locatoroptions.md) | | +| [LocatorScrollOptions](./puppeteer.locatorscrolloptions.md) | | +| [MediaFeature](./puppeteer.mediafeature.md) | | +| [Metrics](./puppeteer.metrics.md) | | +| [MouseClickOptions](./puppeteer.mouseclickoptions.md) | | +| [MouseMoveOptions](./puppeteer.mousemoveoptions.md) | | +| [MouseOptions](./puppeteer.mouseoptions.md) | | +| [MouseWheelOptions](./puppeteer.mousewheeloptions.md) | | +| [Moveable](./puppeteer.moveable.md) | | +| [NetworkConditions](./puppeteer.networkconditions.md) | | +| [NewDocumentScriptEvaluation](./puppeteer.newdocumentscriptevaluation.md) | | +| [Offset](./puppeteer.offset.md) | | +| [PageEvents](./puppeteer.pageevents.md) |

Denotes the objects received by callback functions for page events.

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

| +| [PDFMargin](./puppeteer.pdfmargin.md) | | +| [PDFOptions](./puppeteer.pdfoptions.md) | Valid options to configure PDF generation via [Page.pdf()](./puppeteer.page.pdf.md). | +| [Point](./puppeteer.point.md) | | +| [PuppeteerErrors](./puppeteer.puppeteererrors.md) | | +| [PuppeteerLaunchOptions](./puppeteer.puppeteerlaunchoptions.md) | | +| [RemoteAddress](./puppeteer.remoteaddress.md) | | +| [ResponseForRequest](./puppeteer.responseforrequest.md) | Required response data to fulfill a request with. | +| [ScreenshotClip](./puppeteer.screenshotclip.md) | | +| [ScreenshotOptions](./puppeteer.screenshotoptions.md) | | +| [SerializedAXNode](./puppeteer.serializedaxnode.md) | Represents a Node and the properties of it that are relevant to Accessibility. | +| [SnapshotOptions](./puppeteer.snapshotoptions.md) | | +| [TracingOptions](./puppeteer.tracingoptions.md) | | +| [Viewport](./puppeteer.viewport.md) | | +| [WaitForOptions](./puppeteer.waitforoptions.md) | | +| [WaitForSelectorOptions](./puppeteer.waitforselectoroptions.md) | | +| [WaitForTargetOptions](./puppeteer.waitfortargetoptions.md) | | +| [WaitTimeoutOptions](./puppeteer.waittimeoutoptions.md) | | ## Variables @@ -155,13 +160,14 @@ sidebar_label: API | [Awaitable](./puppeteer.awaitable.md) | | | [AwaitableIterable](./puppeteer.awaitableiterable.md) | | | [AwaitedLocator](./puppeteer.awaitedlocator.md) | | +| [CDPEvents](./puppeteer.cdpevents.md) | | | [ChromeReleaseChannel](./puppeteer.chromereleasechannel.md) | | | [ConsoleMessageType](./puppeteer.consolemessagetype.md) | The supported types for console messages. | | [ElementFor](./puppeteer.elementfor.md) | | | [ErrorCode](./puppeteer.errorcode.md) | | | [EvaluateFunc](./puppeteer.evaluatefunc.md) | | | [EvaluateFuncWith](./puppeteer.evaluatefuncwith.md) | | -| [EventType](./puppeteer.eventtype.md) | | +| [EventsWithWildcard](./puppeteer.eventswithwildcard.md) | | | [ExperimentsConfiguration](./puppeteer.experimentsconfiguration.md) |

Defines experiment options for Puppeteer.

See individual properties for more information.

| | [FlattenHandle](./puppeteer.flattenhandle.md) | | | [HandleFor](./puppeteer.handlefor.md) | | diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.accessibility.md b/website/versioned_docs/version-21.3.0/api/puppeteer.accessibility.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.accessibility.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.accessibility.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.accessibility.snapshot.md b/website/versioned_docs/version-21.3.0/api/puppeteer.accessibility.snapshot.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.accessibility.snapshot.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.accessibility.snapshot.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.actionoptions.md b/website/versioned_docs/version-21.3.0/api/puppeteer.actionoptions.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.actionoptions.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.actionoptions.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.actionresult.md b/website/versioned_docs/version-21.3.0/api/puppeteer.actionresult.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.actionresult.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.actionresult.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.autofilldata.md b/website/versioned_docs/version-21.3.0/api/puppeteer.autofilldata.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.autofilldata.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.autofilldata.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.awaitable.md b/website/versioned_docs/version-21.3.0/api/puppeteer.awaitable.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.awaitable.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.awaitable.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.awaitableiterable.md b/website/versioned_docs/version-21.3.0/api/puppeteer.awaitableiterable.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.awaitableiterable.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.awaitableiterable.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.awaitedlocator.md b/website/versioned_docs/version-21.3.0/api/puppeteer.awaitedlocator.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.awaitedlocator.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.awaitedlocator.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.boundingbox.md b/website/versioned_docs/version-21.3.0/api/puppeteer.boundingbox.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.boundingbox.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.boundingbox.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.boxmodel.md b/website/versioned_docs/version-21.3.0/api/puppeteer.boxmodel.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.boxmodel.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.boxmodel.md diff --git a/website/versioned_docs/version-21.3.0/api/puppeteer.browser.browsercontexts.md b/website/versioned_docs/version-21.3.0/api/puppeteer.browser.browsercontexts.md new file mode 100644 index 00000000000..1db6858fcdb --- /dev/null +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.browser.browsercontexts.md @@ -0,0 +1,21 @@ +--- +sidebar_label: Browser.browserContexts +--- + +# Browser.browserContexts() method + +Gets a list of open [browser contexts](./puppeteer.browsercontext.md). + +In a newly-created [browser](./puppeteer.browser.md), this will return a single instance of [BrowserContext](./puppeteer.browsercontext.md). + +#### Signature: + +```typescript +class Browser { + abstract browserContexts(): BrowserContext[]; +} +``` + +**Returns:** + +[BrowserContext](./puppeteer.browsercontext.md)\[\] diff --git a/website/versioned_docs/version-21.3.0/api/puppeteer.browser.close.md b/website/versioned_docs/version-21.3.0/api/puppeteer.browser.close.md new file mode 100644 index 00000000000..5955b67162b --- /dev/null +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.browser.close.md @@ -0,0 +1,19 @@ +--- +sidebar_label: Browser.close +--- + +# Browser.close() method + +Closes this [browser](./puppeteer.browser.md) and all associated [pages](./puppeteer.page.md). + +#### Signature: + +```typescript +class Browser { + abstract close(): Promise; +} +``` + +**Returns:** + +Promise<void> diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.browser.createincognitobrowsercontext.md b/website/versioned_docs/version-21.3.0/api/puppeteer.browser.createincognitobrowsercontext.md similarity index 54% rename from website/versioned_docs/version-21.2.1/api/puppeteer.browser.createincognitobrowsercontext.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.browser.createincognitobrowsercontext.md index 5660dcf31cc..73870039f94 100644 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.browser.createincognitobrowsercontext.md +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.browser.createincognitobrowsercontext.md @@ -4,13 +4,15 @@ sidebar_label: Browser.createIncognitoBrowserContext # Browser.createIncognitoBrowserContext() method -Creates a new incognito browser context. This won't share cookies/cache with other browser contexts. +Creates a new incognito [browser context](./puppeteer.browsercontext.md). + +This won't share cookies/cache with other [browser contexts](./puppeteer.browsercontext.md). #### Signature: ```typescript class Browser { - createIncognitoBrowserContext( + abstract createIncognitoBrowserContext( options?: BrowserContextOptions ): Promise; } @@ -29,13 +31,13 @@ Promise<[BrowserContext](./puppeteer.browsercontext.md)> ## Example ```ts -(async () => { - const browser = await puppeteer.launch(); - // Create a new incognito browser context. - const context = await browser.createIncognitoBrowserContext(); - // Create a new page in a pristine context. - const page = await context.newPage(); - // Do stuff - await page.goto('https://example.com'); -})(); +import puppeteer from 'puppeteer'; + +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-21.2.1/api/puppeteer.browser.defaultbrowsercontext.md b/website/versioned_docs/version-21.3.0/api/puppeteer.browser.defaultbrowsercontext.md similarity index 50% rename from website/versioned_docs/version-21.2.1/api/puppeteer.browser.defaultbrowsercontext.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.browser.defaultbrowsercontext.md index ce6262fb8f0..7070266fae1 100644 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.browser.defaultbrowsercontext.md +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.browser.defaultbrowsercontext.md @@ -4,16 +4,20 @@ sidebar_label: Browser.defaultBrowserContext # Browser.defaultBrowserContext() method -Returns the default browser context. The default browser context cannot be closed. +Gets the default [browser context](./puppeteer.browsercontext.md). #### Signature: ```typescript class Browser { - defaultBrowserContext(): BrowserContext; + abstract defaultBrowserContext(): BrowserContext; } ``` **Returns:** [BrowserContext](./puppeteer.browsercontext.md) + +## Remarks + +The default [browser context](./puppeteer.browsercontext.md) cannot be closed. diff --git a/website/versioned_docs/version-21.3.0/api/puppeteer.browser.disconnect.md b/website/versioned_docs/version-21.3.0/api/puppeteer.browser.disconnect.md new file mode 100644 index 00000000000..b7611b72a23 --- /dev/null +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.browser.disconnect.md @@ -0,0 +1,19 @@ +--- +sidebar_label: Browser.disconnect +--- + +# Browser.disconnect() method + +Disconnects Puppeteer from this [browser](./puppeteer.browser.md), but leaves the process running. + +#### Signature: + +```typescript +class Browser { + disconnect(): void; +} +``` + +**Returns:** + +void diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.browser.isconnected.md b/website/versioned_docs/version-21.3.0/api/puppeteer.browser.isconnected.md similarity index 50% rename from website/versioned_docs/version-21.2.1/api/puppeteer.browser.isconnected.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.browser.isconnected.md index 190afde7aa7..95d1cc51b05 100644 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.browser.isconnected.md +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.browser.isconnected.md @@ -4,7 +4,11 @@ sidebar_label: Browser.isConnected # Browser.isConnected() method -Indicates that the browser is connected. +> Warning: This API is now obsolete. +> +> Use [Browser.connected](./puppeteer.browser.connected.md). + +Whether Puppeteer is connected to this [browser](./puppeteer.browser.md). #### Signature: diff --git a/website/versioned_docs/version-21.3.0/api/puppeteer.browser.md b/website/versioned_docs/version-21.3.0/api/puppeteer.browser.md new file mode 100644 index 00000000000..c32ab0f0a59 --- /dev/null +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.browser.md @@ -0,0 +1,81 @@ +--- +sidebar_label: Browser +--- + +# Browser class + +[Browser](./puppeteer.browser.md) represents a browser instance that is either: + +- connected to via [Puppeteer.connect()](./puppeteer.puppeteer.connect.md) or - launched by [PuppeteerNode.launch()](./puppeteer.puppeteernode.launch.md). + +[Browser](./puppeteer.browser.md) [emits](./puppeteer.eventemitter.md) various events which are documented in the [BrowserEvent](./puppeteer.browserevent.md) enum. + +#### Signature: + +```typescript +export declare abstract class Browser extends EventEmitter +``` + +**Extends:** [EventEmitter](./puppeteer.eventemitter.md)<[BrowserEvents](./puppeteer.browserevents.md)> + +## Remarks + +The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `Browser` class. + +## Example 1 + +Using a [Browser](./puppeteer.browser.md) to create a [Page](./puppeteer.page.md): + +```ts +import puppeteer from 'puppeteer'; + +const browser = await puppeteer.launch(); +const page = await browser.newPage(); +await page.goto('https://example.com'); +await browser.close(); +``` + +## Example 2 + +Disconnecting from and reconnecting to a [Browser](./puppeteer.browser.md): + +```ts +import puppeteer from 'puppeteer'; + +const browser = await puppeteer.launch(); +// Store the endpoint to be able to reconnect to the browser. +const browserWSEndpoint = browser.wsEndpoint(); +// Disconnect puppeteer from the browser. +browser.disconnect(); + +// Use the endpoint to reestablish a connection +const browser2 = await puppeteer.connect({browserWSEndpoint}); +// Close the browser. +await browser2.close(); +``` + +## Properties + +| Property | Modifiers | Type | Description | +| --------- | --------------------- | ------- | ------------------------------------------------------------------------- | +| connected | readonly | boolean | Whether Puppeteer is connected to this [browser](./puppeteer.browser.md). | + +## Methods + +| Method | Modifiers | Description | +| ---------------------------------------------------------------------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [browserContexts()](./puppeteer.browser.browsercontexts.md) | |

Gets a list of open [browser contexts](./puppeteer.browsercontext.md).

In a newly-created [browser](./puppeteer.browser.md), this will return a single instance of [BrowserContext](./puppeteer.browsercontext.md).

| +| [close()](./puppeteer.browser.close.md) | | Closes this [browser](./puppeteer.browser.md) and all associated [pages](./puppeteer.page.md). | +| [createIncognitoBrowserContext(options)](./puppeteer.browser.createincognitobrowsercontext.md) | |

Creates a new incognito [browser context](./puppeteer.browsercontext.md).

This won't share cookies/cache with other [browser contexts](./puppeteer.browsercontext.md).

| +| [defaultBrowserContext()](./puppeteer.browser.defaultbrowsercontext.md) | | Gets the default [browser context](./puppeteer.browsercontext.md). | +| [disconnect()](./puppeteer.browser.disconnect.md) | | Disconnects Puppeteer from this [browser](./puppeteer.browser.md), but leaves the process running. | +| [isConnected()](./puppeteer.browser.isconnected.md) | | Whether Puppeteer is connected to this [browser](./puppeteer.browser.md). | +| [newPage()](./puppeteer.browser.newpage.md) | | Creates a new [page](./puppeteer.page.md) in the [default browser context](./puppeteer.browser.defaultbrowsercontext.md). | +| [pages()](./puppeteer.browser.pages.md) | |

Gets a list of all open [pages](./puppeteer.page.md) inside this .

If there ar multiple [browser contexts](./puppeteer.browsercontext.md), this returns all [pages](./puppeteer.page.md) in all [browser contexts](./puppeteer.browsercontext.md).

| +| [process()](./puppeteer.browser.process.md) | | Gets the associated [ChildProcess](https://nodejs.org/api/child_process.html#class-childprocess). | +| [target()](./puppeteer.browser.target.md) | | Gets the [target](./puppeteer.target.md) associated with the [default browser context](./puppeteer.browser.defaultbrowsercontext.md)). | +| [targets()](./puppeteer.browser.targets.md) | |

Gets all active [targets](./puppeteer.target.md).

In case of multiple [browser contexts](./puppeteer.browsercontext.md), this returns all [targets](./puppeteer.target.md) in all [browser contexts](./puppeteer.browsercontext.md).

| +| [userAgent()](./puppeteer.browser.useragent.md) | |

Gets this [browser's](./puppeteer.browser.md) original user agent.

[Pages](./puppeteer.page.md) can override the user agent with [Page.setUserAgent()](./puppeteer.page.setuseragent.md).

| +| [version()](./puppeteer.browser.version.md) | |

Gets a string representing this [browser's](./puppeteer.browser.md) name and version.

For headless browser, this is similar to "HeadlessChrome/61.0.3153.0". For non-headless or new-headless, this is similar to "Chrome/61.0.3153.0". For Firefox, it is similar to "Firefox/116.0a1".

The format of [Browser.version()](./puppeteer.browser.version.md) might change with future releases of browsers.

| +| [waitForTarget(predicate, options)](./puppeteer.browser.waitfortarget.md) | |

Waits until a [target](./puppeteer.target.md) matching the given predicate appears and returns it.

This will look all open [browser contexts](./puppeteer.browsercontext.md).

| +| [wsEndpoint()](./puppeteer.browser.wsendpoint.md) | |

Gets the WebSocket URL to connect to this [browser](./puppeteer.browser.md).

This is usually used with [Puppeteer.connect()](./puppeteer.puppeteer.connect.md).

You can find the debugger URL (webSocketDebuggerUrl) from http://${host}:${port}/json/version.

See [browser endpoint](https://chromedevtools.github.io/devtools-protocol/#how-do-i-access-the-browser-target) for more information.

| diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.browser.newpage.md b/website/versioned_docs/version-21.3.0/api/puppeteer.browser.newpage.md similarity index 53% rename from website/versioned_docs/version-21.2.1/api/puppeteer.browser.newpage.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.browser.newpage.md index 4f659e3f851..9be04d72dae 100644 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.browser.newpage.md +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.browser.newpage.md @@ -4,13 +4,13 @@ sidebar_label: Browser.newPage # Browser.newPage() method -Promise which resolves to a new [Page](./puppeteer.page.md) object. The Page is created in a default browser context. +Creates a new [page](./puppeteer.page.md) in the [default browser context](./puppeteer.browser.defaultbrowsercontext.md). #### Signature: ```typescript class Browser { - newPage(): Promise; + abstract newPage(): Promise; } ``` diff --git a/website/versioned_docs/version-21.3.0/api/puppeteer.browser.pages.md b/website/versioned_docs/version-21.3.0/api/puppeteer.browser.pages.md new file mode 100644 index 00000000000..98cf276e4ab --- /dev/null +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.browser.pages.md @@ -0,0 +1,25 @@ +--- +sidebar_label: Browser.pages +--- + +# Browser.pages() method + +Gets a list of all open [pages](./puppeteer.page.md) inside this . + +If there ar multiple [browser contexts](./puppeteer.browsercontext.md), this returns all [pages](./puppeteer.page.md) in all [browser contexts](./puppeteer.browsercontext.md). + +#### Signature: + +```typescript +class Browser { + pages(): Promise; +} +``` + +**Returns:** + +Promise<[Page](./puppeteer.page.md)\[\]> + +## Remarks + +Non-visible [pages](./puppeteer.page.md), 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-21.3.0/api/puppeteer.browser.process.md b/website/versioned_docs/version-21.3.0/api/puppeteer.browser.process.md new file mode 100644 index 00000000000..135de89e5fc --- /dev/null +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.browser.process.md @@ -0,0 +1,21 @@ +--- +sidebar_label: Browser.process +--- + +# Browser.process() method + +Gets the associated [ChildProcess](https://nodejs.org/api/child_process.html#class-childprocess). + +#### Signature: + +```typescript +class Browser { + process(): ChildProcess | null; +} +``` + +**Returns:** + +ChildProcess \| null + +`null` if this instance was connected to via [Puppeteer.connect()](./puppeteer.puppeteer.connect.md). diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.browser.target.md b/website/versioned_docs/version-21.3.0/api/puppeteer.browser.target.md similarity index 50% rename from website/versioned_docs/version-21.2.1/api/puppeteer.browser.target.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.browser.target.md index 63d29b520b5..8adc46c9957 100644 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.browser.target.md +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.browser.target.md @@ -4,13 +4,13 @@ sidebar_label: Browser.target # Browser.target() method -The target associated with the browser. +Gets the [target](./puppeteer.target.md) associated with the [default browser context](./puppeteer.browser.defaultbrowsercontext.md)). #### Signature: ```typescript class Browser { - target(): Target; + abstract target(): Target; } ``` diff --git a/website/versioned_docs/version-21.3.0/api/puppeteer.browser.targets.md b/website/versioned_docs/version-21.3.0/api/puppeteer.browser.targets.md new file mode 100644 index 00000000000..f3748f794fb --- /dev/null +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.browser.targets.md @@ -0,0 +1,21 @@ +--- +sidebar_label: Browser.targets +--- + +# Browser.targets() method + +Gets all active [targets](./puppeteer.target.md). + +In case of multiple [browser contexts](./puppeteer.browsercontext.md), this returns all [targets](./puppeteer.target.md) in all [browser contexts](./puppeteer.browsercontext.md). + +#### Signature: + +```typescript +class Browser { + abstract targets(): Target[]; +} +``` + +**Returns:** + +[Target](./puppeteer.target.md)\[\] diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.browser.useragent.md b/website/versioned_docs/version-21.3.0/api/puppeteer.browser.useragent.md similarity index 51% rename from website/versioned_docs/version-21.2.1/api/puppeteer.browser.useragent.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.browser.useragent.md index d34f16d457f..2e2cb214a92 100644 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.browser.useragent.md +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.browser.useragent.md @@ -4,7 +4,9 @@ sidebar_label: Browser.userAgent # Browser.userAgent() method -The browser's original user agent. Pages can override the browser user agent with [Page.setUserAgent()](./puppeteer.page.setuseragent.md). +Gets this [browser's](./puppeteer.browser.md) original user agent. + +[Pages](./puppeteer.page.md) can override the user agent with [Page.setUserAgent()](./puppeteer.page.setuseragent.md). #### Signature: diff --git a/website/versioned_docs/version-21.3.0/api/puppeteer.browser.version.md b/website/versioned_docs/version-21.3.0/api/puppeteer.browser.version.md new file mode 100644 index 00000000000..c4e6404f89c --- /dev/null +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.browser.version.md @@ -0,0 +1,23 @@ +--- +sidebar_label: Browser.version +--- + +# Browser.version() method + +Gets a string representing this [browser's](./puppeteer.browser.md) name and version. + +For headless browser, this is similar to `"HeadlessChrome/61.0.3153.0"`. For non-headless or new-headless, this is similar to `"Chrome/61.0.3153.0"`. For Firefox, it is similar to `"Firefox/116.0a1"`. + +The format of [Browser.version()](./puppeteer.browser.version.md) might change with future releases of browsers. + +#### Signature: + +```typescript +class Browser { + abstract version(): Promise; +} +``` + +**Returns:** + +Promise<string> diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.browser.waitfortarget.md b/website/versioned_docs/version-21.3.0/api/puppeteer.browser.waitfortarget.md similarity index 63% rename from website/versioned_docs/version-21.2.1/api/puppeteer.browser.waitfortarget.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.browser.waitfortarget.md index 4e7794259a9..d83d47ea9b9 100644 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.browser.waitfortarget.md +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.browser.waitfortarget.md @@ -4,7 +4,9 @@ sidebar_label: Browser.waitForTarget # Browser.waitForTarget() method -Searches for a target in all browser contexts. +Waits until a [target](./puppeteer.target.md) matching the given `predicate` appears and returns it. + +This will look all open [browser contexts](./puppeteer.browsercontext.md). #### Signature: @@ -19,20 +21,18 @@ class Browser { ## Parameters -| Parameter | Type | Description | -| --------- | ---------------------------------------------------------------------------- | -------------------------------------- | -| predicate | (x: [Target](./puppeteer.target.md)) => boolean \| Promise<boolean> | A function to be run for every target. | -| options | [WaitForTargetOptions](./puppeteer.waitfortargetoptions.md) | _(Optional)_ | +| Parameter | Type | Description | +| --------- | ---------------------------------------------------------------------------- | ------------ | +| predicate | (x: [Target](./puppeteer.target.md)) => boolean \| Promise<boolean> | | +| options | [WaitForTargetOptions](./puppeteer.waitfortargetoptions.md) | _(Optional)_ | **Returns:** Promise<[Target](./puppeteer.target.md)> -The first target found that matches the `predicate` function. - ## Example -An example of finding a target for a page opened via `window.open`: +Finding a target for a page opened via `window.open`: ```ts await page.evaluate(() => window.open('https://www.example.com/')); diff --git a/website/versioned_docs/version-21.3.0/api/puppeteer.browser.wsendpoint.md b/website/versioned_docs/version-21.3.0/api/puppeteer.browser.wsendpoint.md new file mode 100644 index 00000000000..496719f5279 --- /dev/null +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.browser.wsendpoint.md @@ -0,0 +1,29 @@ +--- +sidebar_label: Browser.wsEndpoint +--- + +# Browser.wsEndpoint() method + +Gets the WebSocket URL to connect to this [browser](./puppeteer.browser.md). + +This is usually used with [Puppeteer.connect()](./puppeteer.puppeteer.connect.md). + +You can find the debugger URL (`webSocketDebuggerUrl`) from `http://${host}:${port}/json/version`. + +See [browser endpoint](https://chromedevtools.github.io/devtools-protocol/#how-do-i-access-the-browser-target) for more information. + +#### Signature: + +```typescript +class Browser { + abstract wsEndpoint(): string; +} +``` + +**Returns:** + +string + +## Remarks + +The format is always `ws://${host}:${port}/devtools/browser/`. diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.browserconnectoptions.md b/website/versioned_docs/version-21.3.0/api/puppeteer.browserconnectoptions.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.browserconnectoptions.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.browserconnectoptions.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.browsercontext.browser.md b/website/versioned_docs/version-21.3.0/api/puppeteer.browsercontext.browser.md similarity index 56% rename from website/versioned_docs/version-21.2.1/api/puppeteer.browsercontext.browser.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.browsercontext.browser.md index 57d3f79516e..77f54aaad9c 100644 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.browsercontext.browser.md +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.browsercontext.browser.md @@ -4,13 +4,13 @@ sidebar_label: BrowserContext.browser # BrowserContext.browser() method -The browser this browser context belongs to. +Gets the [browser](./puppeteer.browser.md) associated with this [browser context](./puppeteer.browsercontext.md). #### Signature: ```typescript class BrowserContext { - browser(): Browser; + abstract browser(): Browser; } ``` diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.browsercontext.clearpermissionoverrides.md b/website/versioned_docs/version-21.3.0/api/puppeteer.browsercontext.clearpermissionoverrides.md similarity index 68% rename from website/versioned_docs/version-21.2.1/api/puppeteer.browsercontext.clearpermissionoverrides.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.browsercontext.clearpermissionoverrides.md index 9be59d2d1c3..d86657c7046 100644 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.browsercontext.clearpermissionoverrides.md +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.browsercontext.clearpermissionoverrides.md @@ -4,7 +4,7 @@ sidebar_label: BrowserContext.clearPermissionOverrides # BrowserContext.clearPermissionOverrides() method -Clears all permission overrides for the browser context. +Clears all permission overrides for this [browser context](./puppeteer.browsercontext.md). #### Signature: @@ -20,6 +20,8 @@ Promise<void> ## Example +Clearing overridden permissions in the [default browser context](./puppeteer.browser.defaultbrowsercontext.md): + ```ts const context = browser.defaultBrowserContext(); context.overridePermissions('https://example.com', ['clipboard-read']); diff --git a/website/versioned_docs/version-21.3.0/api/puppeteer.browsercontext.close.md b/website/versioned_docs/version-21.3.0/api/puppeteer.browsercontext.close.md new file mode 100644 index 00000000000..ad416cd042b --- /dev/null +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.browsercontext.close.md @@ -0,0 +1,23 @@ +--- +sidebar_label: BrowserContext.close +--- + +# BrowserContext.close() method + +Closes this [browser context](./puppeteer.browsercontext.md) and all associated [pages](./puppeteer.page.md). + +#### Signature: + +```typescript +class BrowserContext { + abstract close(): Promise; +} +``` + +**Returns:** + +Promise<void> + +## Remarks + +The [default browser context](./puppeteer.browser.defaultbrowsercontext.md) cannot be closed. diff --git a/website/versioned_docs/version-21.3.0/api/puppeteer.browsercontext.isincognito.md b/website/versioned_docs/version-21.3.0/api/puppeteer.browsercontext.isincognito.md new file mode 100644 index 00000000000..a8d6292a5d2 --- /dev/null +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.browsercontext.isincognito.md @@ -0,0 +1,21 @@ +--- +sidebar_label: BrowserContext.isIncognito +--- + +# BrowserContext.isIncognito() method + +Whether this [browser context](./puppeteer.browsercontext.md) is incognito. + +The [default browser context](./puppeteer.browser.defaultbrowsercontext.md) is the only non-incognito browser context. + +#### Signature: + +```typescript +class BrowserContext { + abstract isIncognito(): boolean; +} +``` + +**Returns:** + +boolean diff --git a/website/versioned_docs/version-21.3.0/api/puppeteer.browsercontext.md b/website/versioned_docs/version-21.3.0/api/puppeteer.browsercontext.md new file mode 100644 index 00000000000..87c6540f5dc --- /dev/null +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.browsercontext.md @@ -0,0 +1,61 @@ +--- +sidebar_label: BrowserContext +--- + +# BrowserContext class + +[BrowserContext](./puppeteer.browsercontext.md) represents individual sessions within a [browser](./puppeteer.browser.md). + +When a [browser](./puppeteer.browser.md) is launched, it has a single [browser context](./puppeteer.browsercontext.md) by default. Others can be created using [Browser.createIncognitoBrowserContext()](./puppeteer.browser.createincognitobrowsercontext.md). + +[BrowserContext](./puppeteer.browsercontext.md) [emits](./puppeteer.eventemitter.md) various events which are documented in the [BrowserContextEvent](./puppeteer.browsercontextevent.md) enum. + +If a [page](./puppeteer.page.md) opens another [page](./puppeteer.page.md), e.g. using `window.open`, the popup will belong to the parent [page's browser context](./puppeteer.page.browsercontext.md). + +#### Signature: + +```typescript +export declare abstract class BrowserContext extends EventEmitter +``` + +**Extends:** [EventEmitter](./puppeteer.eventemitter.md)<[BrowserContextEvents](./puppeteer.browsercontextevents.md)> + +## Remarks + +The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `BrowserContext` class. + +## Example + +Creating an incognito [browser context](./puppeteer.browsercontext.md): + +```ts +// Create a new incognito browser context +const context = await browser.createIncognitoBrowserContext(); +// Create a new page inside context. +const page = await context.newPage(); +// ... do stuff with page ... +await page.goto('https://example.com'); +// Dispose context once it's no longer needed. +await context.close(); +``` + +## Properties + +| Property | Modifiers | Type | Description | +| -------- | --------------------- | ------------------- | ------------------------------------------------------------------------ | +| closed | readonly | boolean | Whether this [browser context](./puppeteer.browsercontext.md) is closed. | +| id | readonly | string \| undefined | Identifier for this [browser context](./puppeteer.browsercontext.md). | + +## Methods + +| Method | Modifiers | Description | +| --------------------------------------------------------------------------------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [browser()](./puppeteer.browsercontext.browser.md) | | Gets the [browser](./puppeteer.browser.md) associated with this [browser context](./puppeteer.browsercontext.md). | +| [clearPermissionOverrides()](./puppeteer.browsercontext.clearpermissionoverrides.md) | | Clears all permission overrides for this [browser context](./puppeteer.browsercontext.md). | +| [close()](./puppeteer.browsercontext.close.md) | | Closes this [browser context](./puppeteer.browsercontext.md) and all associated [pages](./puppeteer.page.md). | +| [isIncognito()](./puppeteer.browsercontext.isincognito.md) | |

Whether this [browser context](./puppeteer.browsercontext.md) is incognito.

The [default browser context](./puppeteer.browser.defaultbrowsercontext.md) is the only non-incognito browser context.

| +| [newPage()](./puppeteer.browsercontext.newpage.md) | | Creates a new [page](./puppeteer.page.md) in this [browser context](./puppeteer.browsercontext.md). | +| [overridePermissions(origin, permissions)](./puppeteer.browsercontext.overridepermissions.md) | | Grants this [browser context](./puppeteer.browsercontext.md) the given permissions within the given origin. | +| [pages()](./puppeteer.browsercontext.pages.md) | | Gets a list of all open [pages](./puppeteer.page.md) inside this [browser context](./puppeteer.browsercontext.md). | +| [targets()](./puppeteer.browsercontext.targets.md) | | Gets all active [targets](./puppeteer.target.md) inside this [browser context](./puppeteer.browsercontext.md). | +| [waitForTarget(predicate, options)](./puppeteer.browsercontext.waitfortarget.md) | |

Waits until a [target](./puppeteer.target.md) matching the given predicate appears and returns it.

This will look all open [browser contexts](./puppeteer.browsercontext.md).

| diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.browsercontext.newpage.md b/website/versioned_docs/version-21.3.0/api/puppeteer.browsercontext.newpage.md similarity index 59% rename from website/versioned_docs/version-21.2.1/api/puppeteer.browsercontext.newpage.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.browsercontext.newpage.md index 83c1da98fbd..351bd977114 100644 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.browsercontext.newpage.md +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.browsercontext.newpage.md @@ -4,13 +4,13 @@ sidebar_label: BrowserContext.newPage # BrowserContext.newPage() method -Creates a new page in the browser context. +Creates a new [page](./puppeteer.page.md) in this [browser context](./puppeteer.browsercontext.md). #### Signature: ```typescript class BrowserContext { - newPage(): Promise; + abstract newPage(): Promise; } ``` diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.browsercontext.overridepermissions.md b/website/versioned_docs/version-21.3.0/api/puppeteer.browsercontext.overridepermissions.md similarity index 83% rename from website/versioned_docs/version-21.2.1/api/puppeteer.browsercontext.overridepermissions.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.browsercontext.overridepermissions.md index caf2a47b660..d0c3ff9e7b4 100644 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.browsercontext.overridepermissions.md +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.browsercontext.overridepermissions.md @@ -4,6 +4,8 @@ sidebar_label: BrowserContext.overridePermissions # BrowserContext.overridePermissions() method +Grants this [browser context](./puppeteer.browsercontext.md) the given `permissions` within the given `origin`. + #### Signature: ```typescript @@ -25,6 +27,8 @@ Promise<void> ## Example +Overriding permissions in the [default browser context](./puppeteer.browser.defaultbrowsercontext.md): + ```ts const context = browser.defaultBrowserContext(); await context.overridePermissions('https://html5demos.com', ['geolocation']); diff --git a/website/versioned_docs/version-21.3.0/api/puppeteer.browsercontext.pages.md b/website/versioned_docs/version-21.3.0/api/puppeteer.browsercontext.pages.md new file mode 100644 index 00000000000..747b6b9ba4f --- /dev/null +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.browsercontext.pages.md @@ -0,0 +1,23 @@ +--- +sidebar_label: BrowserContext.pages +--- + +# BrowserContext.pages() method + +Gets a list of all open [pages](./puppeteer.page.md) inside this [browser context](./puppeteer.browsercontext.md). + +#### Signature: + +```typescript +class BrowserContext { + abstract pages(): Promise; +} +``` + +**Returns:** + +Promise<[Page](./puppeteer.page.md)\[\]> + +## Remarks + +Non-visible [pages](./puppeteer.page.md), 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-21.2.1/api/puppeteer.browsercontext.targets.md b/website/versioned_docs/version-21.3.0/api/puppeteer.browsercontext.targets.md similarity index 66% rename from website/versioned_docs/version-21.2.1/api/puppeteer.browsercontext.targets.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.browsercontext.targets.md index 0c3182eb293..a5f897dc4ef 100644 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.browsercontext.targets.md +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.browsercontext.targets.md @@ -4,7 +4,7 @@ sidebar_label: BrowserContext.targets # BrowserContext.targets() method -An array of all active targets inside the browser context. +Gets all active [targets](./puppeteer.target.md) inside this [browser context](./puppeteer.browsercontext.md). #### Signature: diff --git a/website/versioned_docs/version-21.3.0/api/puppeteer.browsercontext.waitfortarget.md b/website/versioned_docs/version-21.3.0/api/puppeteer.browsercontext.waitfortarget.md new file mode 100644 index 00000000000..690874e85c5 --- /dev/null +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.browsercontext.waitfortarget.md @@ -0,0 +1,44 @@ +--- +sidebar_label: BrowserContext.waitForTarget +--- + +# BrowserContext.waitForTarget() method + +Waits until a [target](./puppeteer.target.md) matching the given `predicate` appears and returns it. + +This will look all open [browser contexts](./puppeteer.browsercontext.md). + +#### Signature: + +```typescript +class BrowserContext { + abstract waitForTarget( + predicate: (x: Target) => boolean | Promise, + options?: { + timeout?: number; + } + ): Promise; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ---------------------------------------------------------------------------- | ------------ | +| predicate | (x: [Target](./puppeteer.target.md)) => boolean \| Promise<boolean> | | +| options | { timeout?: number; } | _(Optional)_ | + +**Returns:** + +Promise<[Target](./puppeteer.target.md)> + +## Example + +Finding a target for a page opened via `window.open`: + +```ts +await page.evaluate(() => window.open('https://www.example.com/')); +const newWindowTarget = await browserContext.waitForTarget( + target => target.url() === 'https://www.example.com/' +); +``` diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.browsercontextemittedevents.md b/website/versioned_docs/version-21.3.0/api/puppeteer.browsercontextevent.md similarity index 93% rename from website/versioned_docs/version-21.2.1/api/puppeteer.browsercontextemittedevents.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.browsercontextevent.md index c395fd3f84e..94dbed0cb43 100644 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.browsercontextemittedevents.md +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.browsercontextevent.md @@ -1,13 +1,13 @@ --- -sidebar_label: BrowserContextEmittedEvents +sidebar_label: BrowserContextEvent --- -# BrowserContextEmittedEvents enum +# BrowserContextEvent enum #### Signature: ```typescript -export declare const enum BrowserContextEmittedEvents +export declare const enum BrowserContextEvent ``` ## Enumeration Members diff --git a/website/versioned_docs/version-21.3.0/api/puppeteer.browsercontextevents.md b/website/versioned_docs/version-21.3.0/api/puppeteer.browsercontextevents.md new file mode 100644 index 00000000000..92dee37e6e9 --- /dev/null +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.browsercontextevents.md @@ -0,0 +1,21 @@ +--- +sidebar_label: BrowserContextEvents +--- + +# BrowserContextEvents interface + +#### Signature: + +```typescript +export interface BrowserContextEvents extends Record +``` + +**Extends:** Record<EventType, unknown> + +## Properties + +| Property | Modifiers | Type | Description | Default | +| --------------- | --------- | ------------------------------- | ----------- | ------- | +| targetchanged | | [Target](./puppeteer.target.md) | | | +| targetcreated | | [Target](./puppeteer.target.md) | | | +| targetdestroyed | | [Target](./puppeteer.target.md) | | | diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.browsercontextoptions.md b/website/versioned_docs/version-21.3.0/api/puppeteer.browsercontextoptions.md similarity index 97% rename from website/versioned_docs/version-21.2.1/api/puppeteer.browsercontextoptions.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.browsercontextoptions.md index 27754f3f0a6..7bbd9bacf4a 100644 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.browsercontextoptions.md +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.browsercontextoptions.md @@ -4,8 +4,6 @@ sidebar_label: BrowserContextOptions # BrowserContextOptions interface -BrowserContext options. - #### Signature: ```typescript diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.browseremittedevents.md b/website/versioned_docs/version-21.3.0/api/puppeteer.browserevent.md similarity index 83% rename from website/versioned_docs/version-21.2.1/api/puppeteer.browseremittedevents.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.browserevent.md index e1c1eedf4e2..4472c3b53a9 100644 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.browseremittedevents.md +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.browserevent.md @@ -1,22 +1,22 @@ --- -sidebar_label: BrowserEmittedEvents +sidebar_label: BrowserEvent --- -# BrowserEmittedEvents enum +# BrowserEvent enum All the events a [browser instance](./puppeteer.browser.md) may emit. #### Signature: ```typescript -export declare const enum BrowserEmittedEvents +export declare const enum BrowserEvent ``` ## Enumeration Members | Member | Value | Description | | --------------- | ---------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| Disconnected | "disconnected" |

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

- browser 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. | +| Disconnected | "disconnected" |

Emitted when Puppeteer gets disconnected from the browser instance. This might happen because either:

- The browser closes/crashes or - [Browser.disconnect()](./puppeteer.browser.disconnect.md) was called.

| +| 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-21.3.0/api/puppeteer.browserevents.md b/website/versioned_docs/version-21.3.0/api/puppeteer.browserevents.md new file mode 100644 index 00000000000..e1789dfed39 --- /dev/null +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.browserevents.md @@ -0,0 +1,22 @@ +--- +sidebar_label: BrowserEvents +--- + +# BrowserEvents interface + +#### Signature: + +```typescript +export interface BrowserEvents extends Record +``` + +**Extends:** Record<EventType, unknown> + +## Properties + +| Property | Modifiers | Type | Description | Default | +| --------------- | --------- | ------------------------------- | ----------- | ------- | +| disconnected | | undefined | | | +| targetchanged | | [Target](./puppeteer.target.md) | | | +| targetcreated | | [Target](./puppeteer.target.md) | | | +| targetdestroyed | | [Target](./puppeteer.target.md) | | | diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.browserlaunchargumentoptions.md b/website/versioned_docs/version-21.3.0/api/puppeteer.browserlaunchargumentoptions.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.browserlaunchargumentoptions.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.browserlaunchargumentoptions.md diff --git a/website/versioned_docs/version-21.3.0/api/puppeteer.cdpevents.md b/website/versioned_docs/version-21.3.0/api/puppeteer.cdpevents.md new file mode 100644 index 00000000000..06df1610121 --- /dev/null +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.cdpevents.md @@ -0,0 +1,13 @@ +--- +sidebar_label: CDPEvents +--- + +# CDPEvents type + +#### Signature: + +```typescript +export type CDPEvents = { + [Property in keyof ProtocolMapping.Events]: ProtocolMapping.Events[Property][0]; +}; +``` diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.cdpsession.connection.md b/website/versioned_docs/version-21.3.0/api/puppeteer.cdpsession.connection.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.cdpsession.connection.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.cdpsession.connection.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.cdpsession.detach.md b/website/versioned_docs/version-21.3.0/api/puppeteer.cdpsession.detach.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.cdpsession.detach.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.cdpsession.detach.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.cdpsession.id.md b/website/versioned_docs/version-21.3.0/api/puppeteer.cdpsession.id.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.cdpsession.id.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.cdpsession.id.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.cdpsession.md b/website/versioned_docs/version-21.3.0/api/puppeteer.cdpsession.md similarity index 92% rename from website/versioned_docs/version-21.2.1/api/puppeteer.cdpsession.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.cdpsession.md index 66d086451bb..7a8a4ade595 100644 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.cdpsession.md +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.cdpsession.md @@ -9,10 +9,10 @@ The `CDPSession` instances are used to talk raw Chrome Devtools Protocol. #### Signature: ```typescript -export declare class CDPSession extends EventEmitter +export declare abstract class CDPSession extends EventEmitter ``` -**Extends:** [EventEmitter](./puppeteer.eventemitter.md) +**Extends:** [EventEmitter](./puppeteer.eventemitter.md)<[CDPSessionEvents](./puppeteer.cdpsessionevents.md)> ## Remarks diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.cdpsession.send.md b/website/versioned_docs/version-21.3.0/api/puppeteer.cdpsession.send.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.cdpsession.send.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.cdpsession.send.md diff --git a/website/versioned_docs/version-21.3.0/api/puppeteer.cdpsessionevents.md b/website/versioned_docs/version-21.3.0/api/puppeteer.cdpsessionevents.md new file mode 100644 index 00000000000..d7365a4d4f1 --- /dev/null +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.cdpsessionevents.md @@ -0,0 +1,13 @@ +--- +sidebar_label: CDPSessionEvents +--- + +# CDPSessionEvents interface + +#### Signature: + +```typescript +export interface CDPSessionEvents extends CDPEvents, Record +``` + +**Extends:** [CDPEvents](./puppeteer.cdpevents.md), Record<EventType, unknown> diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.chromereleasechannel.md b/website/versioned_docs/version-21.3.0/api/puppeteer.chromereleasechannel.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.chromereleasechannel.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.chromereleasechannel.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.clearcustomqueryhandlers.md b/website/versioned_docs/version-21.3.0/api/puppeteer.clearcustomqueryhandlers.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.clearcustomqueryhandlers.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.clearcustomqueryhandlers.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.clickoptions.md b/website/versioned_docs/version-21.3.0/api/puppeteer.clickoptions.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.clickoptions.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.clickoptions.md diff --git a/website/versioned_docs/version-21.3.0/api/puppeteer.commoneventemitter.addlistener.md b/website/versioned_docs/version-21.3.0/api/puppeteer.commoneventemitter.addlistener.md new file mode 100644 index 00000000000..99a8a74433c --- /dev/null +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.commoneventemitter.addlistener.md @@ -0,0 +1,27 @@ +--- +sidebar_label: CommonEventEmitter.addListener +--- + +# CommonEventEmitter.addListener() method + +#### Signature: + +```typescript +interface CommonEventEmitter { + addListener( + type: Key, + handler: Handler + ): this; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ------------------------------------------------------ | ----------- | +| type | Key | | +| handler | [Handler](./puppeteer.handler.md)<Events\[Key\]> | | + +**Returns:** + +this diff --git a/website/versioned_docs/version-21.3.0/api/puppeteer.commoneventemitter.emit.md b/website/versioned_docs/version-21.3.0/api/puppeteer.commoneventemitter.emit.md new file mode 100644 index 00000000000..ce2fef90962 --- /dev/null +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.commoneventemitter.emit.md @@ -0,0 +1,24 @@ +--- +sidebar_label: CommonEventEmitter.emit +--- + +# CommonEventEmitter.emit() method + +#### Signature: + +```typescript +interface CommonEventEmitter { + emit(type: Key, event: Events[Key]): boolean; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ------------- | ----------- | +| type | Key | | +| event | Events\[Key\] | | + +**Returns:** + +boolean diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.commoneventemitter.listenercount.md b/website/versioned_docs/version-21.3.0/api/puppeteer.commoneventemitter.listenercount.md similarity index 54% rename from website/versioned_docs/version-21.2.1/api/puppeteer.commoneventemitter.listenercount.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.commoneventemitter.listenercount.md index bed60848213..36f549feaec 100644 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.commoneventemitter.listenercount.md +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.commoneventemitter.listenercount.md @@ -8,15 +8,15 @@ sidebar_label: CommonEventEmitter.listenerCount ```typescript interface CommonEventEmitter { - listenerCount(event: string): number; + listenerCount(event: keyof Events): number; } ``` ## Parameters -| Parameter | Type | Description | -| --------- | ------ | ----------- | -| event | string | | +| Parameter | Type | Description | +| --------- | ------------ | ----------- | +| event | keyof Events | | **Returns:** diff --git a/website/versioned_docs/version-21.3.0/api/puppeteer.commoneventemitter.md b/website/versioned_docs/version-21.3.0/api/puppeteer.commoneventemitter.md new file mode 100644 index 00000000000..d117efeb4be --- /dev/null +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.commoneventemitter.md @@ -0,0 +1,24 @@ +--- +sidebar_label: CommonEventEmitter +--- + +# CommonEventEmitter interface + +#### Signature: + +```typescript +export interface CommonEventEmitter> +``` + +## Methods + +| Method | Description | +| --------------------------------------------------------------------------------- | ----------- | +| [addListener(type, handler)](./puppeteer.commoneventemitter.addlistener.md) | | +| [emit(type, event)](./puppeteer.commoneventemitter.emit.md) | | +| [listenerCount(event)](./puppeteer.commoneventemitter.listenercount.md) | | +| [off(type, handler)](./puppeteer.commoneventemitter.off.md) | | +| [on(type, handler)](./puppeteer.commoneventemitter.on.md) | | +| [once(type, handler)](./puppeteer.commoneventemitter.once.md) | | +| [removeAllListeners(event)](./puppeteer.commoneventemitter.removealllisteners.md) | | +| [removeListener(type, handler)](./puppeteer.commoneventemitter.removelistener.md) | | diff --git a/website/versioned_docs/version-21.3.0/api/puppeteer.commoneventemitter.off.md b/website/versioned_docs/version-21.3.0/api/puppeteer.commoneventemitter.off.md new file mode 100644 index 00000000000..97fc89602de --- /dev/null +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.commoneventemitter.off.md @@ -0,0 +1,27 @@ +--- +sidebar_label: CommonEventEmitter.off +--- + +# CommonEventEmitter.off() method + +#### Signature: + +```typescript +interface CommonEventEmitter { + off( + type: Key, + handler?: Handler + ): this; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ------------------------------------------------------ | ------------ | +| type | Key | | +| handler | [Handler](./puppeteer.handler.md)<Events\[Key\]> | _(Optional)_ | + +**Returns:** + +this diff --git a/website/versioned_docs/version-21.3.0/api/puppeteer.commoneventemitter.on.md b/website/versioned_docs/version-21.3.0/api/puppeteer.commoneventemitter.on.md new file mode 100644 index 00000000000..5bb0fb6c8f5 --- /dev/null +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.commoneventemitter.on.md @@ -0,0 +1,24 @@ +--- +sidebar_label: CommonEventEmitter.on +--- + +# CommonEventEmitter.on() method + +#### Signature: + +```typescript +interface CommonEventEmitter { + on(type: Key, handler: Handler): this; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ------------------------------------------------------ | ----------- | +| type | Key | | +| handler | [Handler](./puppeteer.handler.md)<Events\[Key\]> | | + +**Returns:** + +this diff --git a/website/versioned_docs/version-21.3.0/api/puppeteer.commoneventemitter.once.md b/website/versioned_docs/version-21.3.0/api/puppeteer.commoneventemitter.once.md new file mode 100644 index 00000000000..f7cae647043 --- /dev/null +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.commoneventemitter.once.md @@ -0,0 +1,27 @@ +--- +sidebar_label: CommonEventEmitter.once +--- + +# CommonEventEmitter.once() method + +#### Signature: + +```typescript +interface CommonEventEmitter { + once( + type: Key, + handler: Handler + ): this; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ------------------------------------------------------ | ----------- | +| type | Key | | +| handler | [Handler](./puppeteer.handler.md)<Events\[Key\]> | | + +**Returns:** + +this diff --git a/website/versioned_docs/version-21.3.0/api/puppeteer.commoneventemitter.removealllisteners.md b/website/versioned_docs/version-21.3.0/api/puppeteer.commoneventemitter.removealllisteners.md new file mode 100644 index 00000000000..7933a05d2f9 --- /dev/null +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.commoneventemitter.removealllisteners.md @@ -0,0 +1,23 @@ +--- +sidebar_label: CommonEventEmitter.removeAllListeners +--- + +# CommonEventEmitter.removeAllListeners() method + +#### Signature: + +```typescript +interface CommonEventEmitter { + removeAllListeners(event?: keyof Events): this; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ------------ | ------------ | +| event | keyof Events | _(Optional)_ | + +**Returns:** + +this diff --git a/website/versioned_docs/version-21.3.0/api/puppeteer.commoneventemitter.removelistener.md b/website/versioned_docs/version-21.3.0/api/puppeteer.commoneventemitter.removelistener.md new file mode 100644 index 00000000000..fbe04a68aa0 --- /dev/null +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.commoneventemitter.removelistener.md @@ -0,0 +1,27 @@ +--- +sidebar_label: CommonEventEmitter.removeListener +--- + +# CommonEventEmitter.removeListener() method + +#### Signature: + +```typescript +interface CommonEventEmitter { + removeListener( + type: Key, + handler: Handler + ): this; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ------------------------------------------------------ | ----------- | +| type | Key | | +| handler | [Handler](./puppeteer.handler.md)<Events\[Key\]> | | + +**Returns:** + +this diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.configuration.md b/website/versioned_docs/version-21.3.0/api/puppeteer.configuration.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.configuration.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.configuration.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.connect.md b/website/versioned_docs/version-21.3.0/api/puppeteer.connect.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.connect.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.connect.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.connection._constructor_.md b/website/versioned_docs/version-21.3.0/api/puppeteer.connection._constructor_.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.connection._constructor_.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.connection._constructor_.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.connection.createsession.md b/website/versioned_docs/version-21.3.0/api/puppeteer.connection.createsession.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.connection.createsession.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.connection.createsession.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.connection.dispose.md b/website/versioned_docs/version-21.3.0/api/puppeteer.connection.dispose.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.connection.dispose.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.connection.dispose.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.connection.fromsession.md b/website/versioned_docs/version-21.3.0/api/puppeteer.connection.fromsession.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.connection.fromsession.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.connection.fromsession.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.connection.md b/website/versioned_docs/version-21.3.0/api/puppeteer.connection.md similarity index 90% rename from website/versioned_docs/version-21.2.1/api/puppeteer.connection.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.connection.md index 3c16caca67b..e6075c76a7f 100644 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.connection.md +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.connection.md @@ -7,10 +7,10 @@ sidebar_label: Connection #### Signature: ```typescript -export declare class Connection extends EventEmitter +export declare class Connection extends EventEmitter ``` -**Extends:** [EventEmitter](./puppeteer.eventemitter.md) +**Extends:** [EventEmitter](./puppeteer.eventemitter.md)<[CDPSessionEvents](./puppeteer.cdpsessionevents.md)> ## Constructors diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.connection.send.md b/website/versioned_docs/version-21.3.0/api/puppeteer.connection.send.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.connection.send.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.connection.send.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.connection.session.md b/website/versioned_docs/version-21.3.0/api/puppeteer.connection.session.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.connection.session.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.connection.session.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.connection.url.md b/website/versioned_docs/version-21.3.0/api/puppeteer.connection.url.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.connection.url.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.connection.url.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.connectiontransport.close.md b/website/versioned_docs/version-21.3.0/api/puppeteer.connectiontransport.close.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.connectiontransport.close.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.connectiontransport.close.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.connectiontransport.md b/website/versioned_docs/version-21.3.0/api/puppeteer.connectiontransport.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.connectiontransport.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.connectiontransport.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.connectiontransport.send.md b/website/versioned_docs/version-21.3.0/api/puppeteer.connectiontransport.send.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.connectiontransport.send.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.connectiontransport.send.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.connectoptions.md b/website/versioned_docs/version-21.3.0/api/puppeteer.connectoptions.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.connectoptions.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.connectoptions.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.consolemessage._constructor_.md b/website/versioned_docs/version-21.3.0/api/puppeteer.consolemessage._constructor_.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.consolemessage._constructor_.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.consolemessage._constructor_.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.consolemessage.args.md b/website/versioned_docs/version-21.3.0/api/puppeteer.consolemessage.args.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.consolemessage.args.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.consolemessage.args.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.consolemessage.location.md b/website/versioned_docs/version-21.3.0/api/puppeteer.consolemessage.location.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.consolemessage.location.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.consolemessage.location.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.consolemessage.md b/website/versioned_docs/version-21.3.0/api/puppeteer.consolemessage.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.consolemessage.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.consolemessage.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.consolemessage.stacktrace.md b/website/versioned_docs/version-21.3.0/api/puppeteer.consolemessage.stacktrace.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.consolemessage.stacktrace.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.consolemessage.stacktrace.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.consolemessage.text.md b/website/versioned_docs/version-21.3.0/api/puppeteer.consolemessage.text.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.consolemessage.text.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.consolemessage.text.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.consolemessage.type.md b/website/versioned_docs/version-21.3.0/api/puppeteer.consolemessage.type.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.consolemessage.type.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.consolemessage.type.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.consolemessagelocation.md b/website/versioned_docs/version-21.3.0/api/puppeteer.consolemessagelocation.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.consolemessagelocation.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.consolemessagelocation.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.consolemessagetype.md b/website/versioned_docs/version-21.3.0/api/puppeteer.consolemessagetype.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.consolemessagetype.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.consolemessagetype.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.continuerequestoverrides.md b/website/versioned_docs/version-21.3.0/api/puppeteer.continuerequestoverrides.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.continuerequestoverrides.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.continuerequestoverrides.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.coverage._constructor_.md b/website/versioned_docs/version-21.3.0/api/puppeteer.coverage._constructor_.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.coverage._constructor_.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.coverage._constructor_.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.coverage.md b/website/versioned_docs/version-21.3.0/api/puppeteer.coverage.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.coverage.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.coverage.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.coverage.startcsscoverage.md b/website/versioned_docs/version-21.3.0/api/puppeteer.coverage.startcsscoverage.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.coverage.startcsscoverage.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.coverage.startcsscoverage.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.coverage.startjscoverage.md b/website/versioned_docs/version-21.3.0/api/puppeteer.coverage.startjscoverage.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.coverage.startjscoverage.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.coverage.startjscoverage.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.coverage.stopcsscoverage.md b/website/versioned_docs/version-21.3.0/api/puppeteer.coverage.stopcsscoverage.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.coverage.stopcsscoverage.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.coverage.stopcsscoverage.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.coverage.stopjscoverage.md b/website/versioned_docs/version-21.3.0/api/puppeteer.coverage.stopjscoverage.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.coverage.stopjscoverage.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.coverage.stopjscoverage.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.coverageentry.md b/website/versioned_docs/version-21.3.0/api/puppeteer.coverageentry.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.coverageentry.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.coverageentry.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.credentials.md b/website/versioned_docs/version-21.3.0/api/puppeteer.credentials.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.credentials.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.credentials.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.csscoverage._constructor_.md b/website/versioned_docs/version-21.3.0/api/puppeteer.csscoverage._constructor_.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.csscoverage._constructor_.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.csscoverage._constructor_.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.csscoverage.md b/website/versioned_docs/version-21.3.0/api/puppeteer.csscoverage.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.csscoverage.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.csscoverage.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.csscoverage.start.md b/website/versioned_docs/version-21.3.0/api/puppeteer.csscoverage.start.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.csscoverage.start.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.csscoverage.start.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.csscoverage.stop.md b/website/versioned_docs/version-21.3.0/api/puppeteer.csscoverage.stop.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.csscoverage.stop.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.csscoverage.stop.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.csscoverageoptions.md b/website/versioned_docs/version-21.3.0/api/puppeteer.csscoverageoptions.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.csscoverageoptions.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.csscoverageoptions.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.customerror.md b/website/versioned_docs/version-21.3.0/api/puppeteer.customerror.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.customerror.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.customerror.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.customqueryhandler.md b/website/versioned_docs/version-21.3.0/api/puppeteer.customqueryhandler.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.customqueryhandler.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.customqueryhandler.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.customqueryhandlernames.md b/website/versioned_docs/version-21.3.0/api/puppeteer.customqueryhandlernames.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.customqueryhandlernames.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.customqueryhandlernames.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.default_intercept_resolution_priority.md b/website/versioned_docs/version-21.3.0/api/puppeteer.default_intercept_resolution_priority.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.default_intercept_resolution_priority.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.default_intercept_resolution_priority.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.defaultargs.md b/website/versioned_docs/version-21.3.0/api/puppeteer.defaultargs.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.defaultargs.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.defaultargs.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.device.md b/website/versioned_docs/version-21.3.0/api/puppeteer.device.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.device.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.device.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.devicerequestprompt.cancel.md b/website/versioned_docs/version-21.3.0/api/puppeteer.devicerequestprompt.cancel.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.devicerequestprompt.cancel.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.devicerequestprompt.cancel.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.devicerequestprompt.md b/website/versioned_docs/version-21.3.0/api/puppeteer.devicerequestprompt.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.devicerequestprompt.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.devicerequestprompt.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.devicerequestprompt.select.md b/website/versioned_docs/version-21.3.0/api/puppeteer.devicerequestprompt.select.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.devicerequestprompt.select.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.devicerequestprompt.select.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.devicerequestprompt.waitfordevice.md b/website/versioned_docs/version-21.3.0/api/puppeteer.devicerequestprompt.waitfordevice.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.devicerequestprompt.waitfordevice.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.devicerequestprompt.waitfordevice.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.devicerequestpromptdevice.md b/website/versioned_docs/version-21.3.0/api/puppeteer.devicerequestpromptdevice.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.devicerequestpromptdevice.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.devicerequestpromptdevice.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.devices.md b/website/versioned_docs/version-21.3.0/api/puppeteer.devices.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.devices.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.devices.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.dialog.accept.md b/website/versioned_docs/version-21.3.0/api/puppeteer.dialog.accept.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.dialog.accept.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.dialog.accept.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.dialog.defaultvalue.md b/website/versioned_docs/version-21.3.0/api/puppeteer.dialog.defaultvalue.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.dialog.defaultvalue.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.dialog.defaultvalue.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.dialog.dismiss.md b/website/versioned_docs/version-21.3.0/api/puppeteer.dialog.dismiss.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.dialog.dismiss.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.dialog.dismiss.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.dialog.md b/website/versioned_docs/version-21.3.0/api/puppeteer.dialog.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.dialog.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.dialog.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.dialog.message.md b/website/versioned_docs/version-21.3.0/api/puppeteer.dialog.message.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.dialog.message.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.dialog.message.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.dialog.type.md b/website/versioned_docs/version-21.3.0/api/puppeteer.dialog.type.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.dialog.type.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.dialog.type.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.elementfor.md b/website/versioned_docs/version-21.3.0/api/puppeteer.elementfor.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.elementfor.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.elementfor.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle._.md b/website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle._.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle._.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle._.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.__.md b/website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.__.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.__.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.__.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.__eval.md b/website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.__eval.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.__eval.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.__eval.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle._eval.md b/website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle._eval.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle._eval.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle._eval.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle._x.md b/website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle._x.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle._x.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle._x.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.autofill.md b/website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.autofill.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.autofill.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.autofill.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.boundingbox.md b/website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.boundingbox.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.boundingbox.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.boundingbox.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.boxmodel.md b/website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.boxmodel.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.boxmodel.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.boxmodel.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.click.md b/website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.click.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.click.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.click.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.clickablepoint.md b/website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.clickablepoint.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.clickablepoint.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.clickablepoint.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.contentframe.md b/website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.contentframe.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.contentframe.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.contentframe.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.contentframe_1.md b/website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.contentframe_1.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.contentframe_1.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.contentframe_1.md diff --git a/website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.drag.md b/website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.drag.md new file mode 100644 index 00000000000..801f4222d40 --- /dev/null +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.drag.md @@ -0,0 +1,31 @@ +--- +sidebar_label: ElementHandle.drag +--- + +# ElementHandle.drag() method + +Drags an element over the given element or point. + +#### Signature: + +```typescript +class ElementHandle { + drag( + this: ElementHandle, + target: Point | ElementHandle + ): Promise; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | --------------------------------------------------------------------------------------------- | ----------- | +| this | [ElementHandle](./puppeteer.elementhandle.md)<Element> | | +| target | [Point](./puppeteer.point.md) \| [ElementHandle](./puppeteer.elementhandle.md)<Element> | | + +**Returns:** + +Promise<Protocol.Input.DragData \| void> + +DEPRECATED. When drag interception is enabled, the drag payload is returned. diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.draganddrop.md b/website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.draganddrop.md similarity index 91% rename from website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.draganddrop.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.draganddrop.md index 48e8e3f05ac..7449ff8eaaf 100644 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.draganddrop.md +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.draganddrop.md @@ -4,7 +4,9 @@ sidebar_label: ElementHandle.dragAndDrop # ElementHandle.dragAndDrop() method -This method triggers a dragenter, dragover, and drop on the element. +> Warning: This API is now obsolete. +> +> Use `ElementHandle.drop` instead. #### Signature: diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.dragenter.md b/website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.dragenter.md similarity index 85% rename from website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.dragenter.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.dragenter.md index c2d620d9f0b..371518b8b55 100644 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.dragenter.md +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.dragenter.md @@ -4,7 +4,9 @@ sidebar_label: ElementHandle.dragEnter # ElementHandle.dragEnter() method -This method creates a `dragenter` event on the element. +> Warning: This API is now obsolete. +> +> Do not use. `dragenter` will automatically be performed during dragging. #### Signature: diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.dragover.md b/website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.dragover.md similarity index 85% rename from website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.dragover.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.dragover.md index 86bbf8d958a..003e8a95eac 100644 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.dragover.md +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.dragover.md @@ -4,7 +4,9 @@ sidebar_label: ElementHandle.dragOver # ElementHandle.dragOver() method -This method creates a `dragover` event on the element. +> Warning: This API is now obsolete. +> +> Do not use. `dragover` will automatically be performed during dragging. #### Signature: diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.drag.md b/website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.drop.md similarity index 55% rename from website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.drag.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.drop.md index 8ae241c97b1..a48303e108c 100644 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.drag.md +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.drop.md @@ -1,19 +1,19 @@ --- -sidebar_label: ElementHandle.drag +sidebar_label: ElementHandle.drop --- -# ElementHandle.drag() method +# ElementHandle.drop() method -This method creates and captures a dragevent from the element. +Drops the given element onto the current one. #### Signature: ```typescript class ElementHandle { - drag( + drop( this: ElementHandle, - target: Point - ): Promise; + element: ElementHandle + ): Promise; } ``` @@ -22,8 +22,8 @@ class ElementHandle { | Parameter | Type | Description | | --------- | ------------------------------------------------------------ | ----------- | | this | [ElementHandle](./puppeteer.elementhandle.md)<Element> | | -| target | [Point](./puppeteer.point.md) | | +| element | [ElementHandle](./puppeteer.elementhandle.md)<Element> | | **Returns:** -Promise<Protocol.Input.DragData> +Promise<void> diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.drop.md b/website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.drop_1.md similarity index 86% rename from website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.drop.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.drop_1.md index 82536f4c19a..cae89f8de0f 100644 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.drop.md +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.drop_1.md @@ -1,10 +1,12 @@ --- -sidebar_label: ElementHandle.drop +sidebar_label: ElementHandle.drop_1 --- # ElementHandle.drop() method -This method triggers a drop on the element. +> Warning: This API is now obsolete. +> +> No longer supported. #### Signature: diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.focus.md b/website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.focus.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.focus.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.focus.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.hover.md b/website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.hover.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.hover.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.hover.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.ishidden.md b/website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.ishidden.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.ishidden.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.ishidden.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.isintersectingviewport.md b/website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.isintersectingviewport.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.isintersectingviewport.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.isintersectingviewport.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.isvisible.md b/website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.isvisible.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.isvisible.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.isvisible.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.md b/website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.md similarity index 93% rename from website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.md index 495ec5142e8..a247ff59479 100644 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.md +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.md @@ -61,11 +61,12 @@ The constructor for this class is marked as internal. Third-party code should no | [clickablePoint(offset)](./puppeteer.elementhandle.clickablepoint.md) | | Returns the middle point within an element unless a specific offset is provided. | | [contentFrame(this)](./puppeteer.elementhandle.contentframe.md) | | Resolves the frame associated with the element, if any. Always exists for HTMLIFrameElements. | | [contentFrame()](./puppeteer.elementhandle.contentframe_1.md) | | | -| [drag(this, target)](./puppeteer.elementhandle.drag.md) | | This method creates and captures a dragevent from the element. | -| [dragAndDrop(this, target, options)](./puppeteer.elementhandle.draganddrop.md) | | This method triggers a dragenter, dragover, and drop on the element. | -| [dragEnter(this, data)](./puppeteer.elementhandle.dragenter.md) | | This method creates a dragenter event on the element. | -| [dragOver(this, data)](./puppeteer.elementhandle.dragover.md) | | This method creates a dragover event on the element. | -| [drop(this, data)](./puppeteer.elementhandle.drop.md) | | This method triggers a drop on the element. | +| [drag(this, target)](./puppeteer.elementhandle.drag.md) | | Drags an element over the given element or point. | +| [dragAndDrop(this, target, options)](./puppeteer.elementhandle.draganddrop.md) | | | +| [dragEnter(this, data)](./puppeteer.elementhandle.dragenter.md) | | | +| [dragOver(this, data)](./puppeteer.elementhandle.dragover.md) | | | +| [drop(this, element)](./puppeteer.elementhandle.drop.md) | | Drops the given element onto the current one. | +| [drop(this, data)](./puppeteer.elementhandle.drop_1.md) | | | | [focus()](./puppeteer.elementhandle.focus.md) | | Calls [focus](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus) on the element. | | [hover(this)](./puppeteer.elementhandle.hover.md) | | This method scrolls element into view if needed, and then uses [Page](./puppeteer.page.md) to hover over the center of the element. If the element is detached from DOM, the method throws an error. | | [isHidden()](./puppeteer.elementhandle.ishidden.md) | | Checks if an element is hidden using the same mechanism as [ElementHandle.waitForSelector()](./puppeteer.elementhandle.waitforselector.md). | diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.press.md b/website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.press.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.press.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.press.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.screenshot.md b/website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.screenshot.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.screenshot.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.screenshot.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.scrollintoview.md b/website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.scrollintoview.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.scrollintoview.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.scrollintoview.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.select.md b/website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.select.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.select.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.select.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.tap.md b/website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.tap.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.tap.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.tap.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.toelement.md b/website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.toelement.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.toelement.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.toelement.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.touchend.md b/website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.touchend.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.touchend.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.touchend.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.touchmove.md b/website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.touchmove.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.touchmove.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.touchmove.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.touchstart.md b/website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.touchstart.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.touchstart.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.touchstart.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.type.md b/website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.type.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.type.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.type.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.uploadfile.md b/website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.uploadfile.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.uploadfile.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.uploadfile.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.waitforselector.md b/website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.waitforselector.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.waitforselector.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.waitforselector.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.waitforxpath.md b/website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.waitforxpath.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.elementhandle.waitforxpath.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.elementhandle.waitforxpath.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.errorcode.md b/website/versioned_docs/version-21.3.0/api/puppeteer.errorcode.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.errorcode.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.errorcode.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.errors.md b/website/versioned_docs/version-21.3.0/api/puppeteer.errors.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.errors.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.errors.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.evaluatefunc.md b/website/versioned_docs/version-21.3.0/api/puppeteer.evaluatefunc.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.evaluatefunc.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.evaluatefunc.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.evaluatefuncwith.md b/website/versioned_docs/version-21.3.0/api/puppeteer.evaluatefuncwith.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.evaluatefuncwith.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.evaluatefuncwith.md diff --git a/website/versioned_docs/version-21.3.0/api/puppeteer.eventemitter.addlistener.md b/website/versioned_docs/version-21.3.0/api/puppeteer.eventemitter.addlistener.md new file mode 100644 index 00000000000..d653ac50dc7 --- /dev/null +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.eventemitter.addlistener.md @@ -0,0 +1,33 @@ +--- +sidebar_label: EventEmitter.addListener +--- + +# EventEmitter.addListener() method + +> Warning: This API is now obsolete. +> +> please use [EventEmitter.on()](./puppeteer.eventemitter.on.md) instead. + +Add an event listener. + +#### Signature: + +```typescript +class EventEmitter { + addListener>( + type: Key, + handler: Handler[Key]> + ): this; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | --------------------------------------------------------------------------------------------------------------------- | ----------- | +| type | Key | | +| handler | [Handler](./puppeteer.handler.md)<[EventsWithWildcard](./puppeteer.eventswithwildcard.md)<Events>\[Key\]> | | + +**Returns:** + +this diff --git a/website/versioned_docs/version-21.3.0/api/puppeteer.eventemitter.emit.md b/website/versioned_docs/version-21.3.0/api/puppeteer.eventemitter.emit.md new file mode 100644 index 00000000000..460b35034bf --- /dev/null +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.eventemitter.emit.md @@ -0,0 +1,31 @@ +--- +sidebar_label: EventEmitter.emit +--- + +# EventEmitter.emit() method + +Emit an event and call any associated listeners. + +#### Signature: + +```typescript +class EventEmitter { + emit>( + type: Key, + event: EventsWithWildcard[Key] + ): boolean; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ---------------------------------------------------------------------------- | ---------------------------- | +| type | Key | the event you'd like to emit | +| event | [EventsWithWildcard](./puppeteer.eventswithwildcard.md)<Events>\[Key\] | | + +**Returns:** + +boolean + +`true` if there are any listeners, `false` if there are not. diff --git a/website/versioned_docs/version-21.3.0/api/puppeteer.eventemitter.listenercount.md b/website/versioned_docs/version-21.3.0/api/puppeteer.eventemitter.listenercount.md new file mode 100644 index 00000000000..279aa5810f9 --- /dev/null +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.eventemitter.listenercount.md @@ -0,0 +1,27 @@ +--- +sidebar_label: EventEmitter.listenerCount +--- + +# EventEmitter.listenerCount() method + +Gets the number of listeners for a given event. + +#### Signature: + +```typescript +class EventEmitter { + listenerCount(type: keyof EventsWithWildcard): number; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | --------------------------------------------------------------------------- | --------------------------------------- | +| type | keyof [EventsWithWildcard](./puppeteer.eventswithwildcard.md)<Events> | 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-21.3.0/api/puppeteer.eventemitter.md b/website/versioned_docs/version-21.3.0/api/puppeteer.eventemitter.md new file mode 100644 index 00000000000..1a3865ba982 --- /dev/null +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.eventemitter.md @@ -0,0 +1,34 @@ +--- +sidebar_label: EventEmitter +--- + +# EventEmitter class + +The EventEmitter class that many Puppeteer classes extend. + +#### Signature: + +```typescript +export declare class EventEmitter> implements CommonEventEmitter> +``` + +**Implements:** [CommonEventEmitter](./puppeteer.commoneventemitter.md)<[EventsWithWildcard](./puppeteer.eventswithwildcard.md)<Events>> + +## 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(type, handler)](./puppeteer.eventemitter.addlistener.md) | | Add an event listener. | +| [emit(type, event)](./puppeteer.eventemitter.emit.md) | | Emit an event and call any associated listeners. | +| [listenerCount(type)](./puppeteer.eventemitter.listenercount.md) | | Gets the number of listeners for a given event. | +| [off(type, handler)](./puppeteer.eventemitter.off.md) | | Remove an event listener from firing. | +| [on(type, handler)](./puppeteer.eventemitter.on.md) | | Bind an event listener to fire when an event occurs. | +| [once(type, handler)](./puppeteer.eventemitter.once.md) | | Like on but the listener will only be fired once and then it will be removed. | +| [removeAllListeners(type)](./puppeteer.eventemitter.removealllisteners.md) | | Removes all listeners. If given an event argument, it will remove only listeners for that event. | +| [removeListener(type, handler)](./puppeteer.eventemitter.removelistener.md) | | Remove an event listener. | diff --git a/website/versioned_docs/version-21.3.0/api/puppeteer.eventemitter.off.md b/website/versioned_docs/version-21.3.0/api/puppeteer.eventemitter.off.md new file mode 100644 index 00000000000..bc3772bdb72 --- /dev/null +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.eventemitter.off.md @@ -0,0 +1,31 @@ +--- +sidebar_label: EventEmitter.off +--- + +# EventEmitter.off() method + +Remove an event listener from firing. + +#### Signature: + +```typescript +class EventEmitter { + off>( + type: Key, + handler?: Handler[Key]> + ): this; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | --------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------- | +| type | Key | the event type you'd like to stop listening to. | +| handler | [Handler](./puppeteer.handler.md)<[EventsWithWildcard](./puppeteer.eventswithwildcard.md)<Events>\[Key\]> | _(Optional)_ the function that should be removed. | + +**Returns:** + +this + +`this` to enable you to chain method calls. diff --git a/website/versioned_docs/version-21.3.0/api/puppeteer.eventemitter.on.md b/website/versioned_docs/version-21.3.0/api/puppeteer.eventemitter.on.md new file mode 100644 index 00000000000..66d4f13c419 --- /dev/null +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.eventemitter.on.md @@ -0,0 +1,31 @@ +--- +sidebar_label: EventEmitter.on +--- + +# EventEmitter.on() method + +Bind an event listener to fire when an event occurs. + +#### Signature: + +```typescript +class EventEmitter { + on>( + type: Key, + handler: Handler[Key]> + ): this; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | --------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ | +| type | Key | the event type you'd like to listen to. Can be a string or symbol. | +| handler | [Handler](./puppeteer.handler.md)<[EventsWithWildcard](./puppeteer.eventswithwildcard.md)<Events>\[Key\]> | the function to be called when the event occurs. | + +**Returns:** + +this + +`this` to enable you to chain method calls. diff --git a/website/versioned_docs/version-21.3.0/api/puppeteer.eventemitter.once.md b/website/versioned_docs/version-21.3.0/api/puppeteer.eventemitter.once.md new file mode 100644 index 00000000000..ade575276e1 --- /dev/null +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.eventemitter.once.md @@ -0,0 +1,31 @@ +--- +sidebar_label: EventEmitter.once +--- + +# EventEmitter.once() method + +Like `on` but the listener will only be fired once and then it will be removed. + +#### Signature: + +```typescript +class EventEmitter { + once>( + type: Key, + handler: Handler[Key]> + ): this; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | --------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------- | +| type | Key | the event you'd like to listen to | +| handler | [Handler](./puppeteer.handler.md)<[EventsWithWildcard](./puppeteer.eventswithwildcard.md)<Events>\[Key\]> | the handler function to run when the event occurs | + +**Returns:** + +this + +`this` to enable you to chain method calls. diff --git a/website/versioned_docs/version-21.3.0/api/puppeteer.eventemitter.removealllisteners.md b/website/versioned_docs/version-21.3.0/api/puppeteer.eventemitter.removealllisteners.md new file mode 100644 index 00000000000..8b876d941ee --- /dev/null +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.eventemitter.removealllisteners.md @@ -0,0 +1,27 @@ +--- +sidebar_label: EventEmitter.removeAllListeners +--- + +# EventEmitter.removeAllListeners() method + +Removes all listeners. If given an event argument, it will remove only listeners for that event. + +#### Signature: + +```typescript +class EventEmitter { + removeAllListeners(type?: keyof EventsWithWildcard): this; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | --------------------------------------------------------------------------- | ----------------------------------------------- | +| type | keyof [EventsWithWildcard](./puppeteer.eventswithwildcard.md)<Events> | _(Optional)_ the event to remove listeners for. | + +**Returns:** + +this + +`this` to enable you to chain method calls. diff --git a/website/versioned_docs/version-21.3.0/api/puppeteer.eventemitter.removelistener.md b/website/versioned_docs/version-21.3.0/api/puppeteer.eventemitter.removelistener.md new file mode 100644 index 00000000000..c2127cebd6d --- /dev/null +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.eventemitter.removelistener.md @@ -0,0 +1,33 @@ +--- +sidebar_label: EventEmitter.removeListener +--- + +# EventEmitter.removeListener() method + +> Warning: This API is now obsolete. +> +> please use [EventEmitter.off()](./puppeteer.eventemitter.off.md) instead. + +Remove an event listener. + +#### Signature: + +```typescript +class EventEmitter { + removeListener>( + type: Key, + handler: Handler[Key]> + ): this; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | --------------------------------------------------------------------------------------------------------------------- | ----------- | +| type | Key | | +| handler | [Handler](./puppeteer.handler.md)<[EventsWithWildcard](./puppeteer.eventswithwildcard.md)<Events>\[Key\]> | | + +**Returns:** + +this diff --git a/website/versioned_docs/version-21.3.0/api/puppeteer.eventswithwildcard.md b/website/versioned_docs/version-21.3.0/api/puppeteer.eventswithwildcard.md new file mode 100644 index 00000000000..5a285f4aecd --- /dev/null +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.eventswithwildcard.md @@ -0,0 +1,14 @@ +--- +sidebar_label: EventsWithWildcard +--- + +# EventsWithWildcard type + +#### Signature: + +```typescript +export type EventsWithWildcard> = + Events & { + '*': Events[keyof Events]; + }; +``` diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.executablepath.md b/website/versioned_docs/version-21.3.0/api/puppeteer.executablepath.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.executablepath.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.executablepath.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.experimentsconfiguration.md b/website/versioned_docs/version-21.3.0/api/puppeteer.experimentsconfiguration.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.experimentsconfiguration.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.experimentsconfiguration.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.filechooser.accept.md b/website/versioned_docs/version-21.3.0/api/puppeteer.filechooser.accept.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.filechooser.accept.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.filechooser.accept.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.filechooser.cancel.md b/website/versioned_docs/version-21.3.0/api/puppeteer.filechooser.cancel.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.filechooser.cancel.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.filechooser.cancel.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.filechooser.ismultiple.md b/website/versioned_docs/version-21.3.0/api/puppeteer.filechooser.ismultiple.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.filechooser.ismultiple.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.filechooser.ismultiple.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.filechooser.md b/website/versioned_docs/version-21.3.0/api/puppeteer.filechooser.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.filechooser.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.filechooser.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.flattenhandle.md b/website/versioned_docs/version-21.3.0/api/puppeteer.flattenhandle.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.flattenhandle.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.flattenhandle.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.frame._.md b/website/versioned_docs/version-21.3.0/api/puppeteer.frame._.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.frame._.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.frame._.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.frame.__.md b/website/versioned_docs/version-21.3.0/api/puppeteer.frame.__.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.frame.__.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.frame.__.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.frame.__eval.md b/website/versioned_docs/version-21.3.0/api/puppeteer.frame.__eval.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.frame.__eval.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.frame.__eval.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.frame._eval.md b/website/versioned_docs/version-21.3.0/api/puppeteer.frame._eval.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.frame._eval.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.frame._eval.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.frame._x.md b/website/versioned_docs/version-21.3.0/api/puppeteer.frame._x.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.frame._x.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.frame._x.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.frame.addscripttag.md b/website/versioned_docs/version-21.3.0/api/puppeteer.frame.addscripttag.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.frame.addscripttag.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.frame.addscripttag.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.frame.addstyletag.md b/website/versioned_docs/version-21.3.0/api/puppeteer.frame.addstyletag.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.frame.addstyletag.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.frame.addstyletag.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.frame.addstyletag_1.md b/website/versioned_docs/version-21.3.0/api/puppeteer.frame.addstyletag_1.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.frame.addstyletag_1.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.frame.addstyletag_1.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.frame.childframes.md b/website/versioned_docs/version-21.3.0/api/puppeteer.frame.childframes.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.frame.childframes.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.frame.childframes.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.frame.click.md b/website/versioned_docs/version-21.3.0/api/puppeteer.frame.click.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.frame.click.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.frame.click.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.frame.content.md b/website/versioned_docs/version-21.3.0/api/puppeteer.frame.content.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.frame.content.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.frame.content.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.frame.evaluate.md b/website/versioned_docs/version-21.3.0/api/puppeteer.frame.evaluate.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.frame.evaluate.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.frame.evaluate.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.frame.evaluatehandle.md b/website/versioned_docs/version-21.3.0/api/puppeteer.frame.evaluatehandle.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.frame.evaluatehandle.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.frame.evaluatehandle.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.frame.focus.md b/website/versioned_docs/version-21.3.0/api/puppeteer.frame.focus.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.frame.focus.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.frame.focus.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.frame.goto.md b/website/versioned_docs/version-21.3.0/api/puppeteer.frame.goto.md similarity index 67% rename from website/versioned_docs/version-21.2.1/api/puppeteer.frame.goto.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.frame.goto.md index df5e6a40d11..52e76313a11 100644 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.frame.goto.md +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.frame.goto.md @@ -4,7 +4,7 @@ sidebar_label: Frame.goto # Frame.goto() method -Navigates a frame to the given url. +Navigates the frame to the given `url`. #### Signature: @@ -24,10 +24,10 @@ class Frame { ## Parameters -| Parameter | Type | Description | -| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| url | string | the URL to navigate the frame to. This should include the scheme, e.g. https://. | -| options | { referer?: string; referrerPolicy?: string; timeout?: number; waitUntil?: [PuppeteerLifeCycleEvent](./puppeteer.puppeteerlifecycleevent.md) \| [PuppeteerLifeCycleEvent](./puppeteer.puppeteerlifecycleevent.md)\[\]; } | _(Optional)_ navigation options. waitUntil is useful to define when the navigation should be considered successful - see the docs for [PuppeteerLifeCycleEvent](./puppeteer.puppeteerlifecycleevent.md) for more details. | +| Parameter | Type | Description | +| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------- | +| url | string | URL to navigate the frame to. The URL should include scheme, e.g. https:// | +| options | { referer?: string; referrerPolicy?: string; timeout?: number; waitUntil?: [PuppeteerLifeCycleEvent](./puppeteer.puppeteerlifecycleevent.md) \| [PuppeteerLifeCycleEvent](./puppeteer.puppeteerlifecycleevent.md)\[\]; } | _(Optional)_ Options to configure waiting behavior. | **Returns:** @@ -37,9 +37,9 @@ A promise which resolves to the main resource response. In case of multiple redi ## Exceptions -This method will throw an error if: +If: -- there's an SSL error (e.g. in case of self-signed certificates). - target URL is invalid. - the `timeout` is exceeded during navigation. - the remote server does not respond or is unreachable. - the main resource failed to load. +- there's an SSL error (e.g. in case of self-signed certificates). - target URL is invalid. - the timeout is exceeded during navigation. - the remote server does not respond or is unreachable. - the main resource failed to load. This method will not throw an error when any valid HTTP status code is returned by the remote server, including 404 "Not Found" and 500 "Internal Server Error". The status code for such responses can be retrieved by calling [HTTPResponse.status()](./puppeteer.httpresponse.status.md). diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.frame.hover.md b/website/versioned_docs/version-21.3.0/api/puppeteer.frame.hover.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.frame.hover.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.frame.hover.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.frame.isdetached.md b/website/versioned_docs/version-21.3.0/api/puppeteer.frame.isdetached.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.frame.isdetached.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.frame.isdetached.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.frame.isoopframe.md b/website/versioned_docs/version-21.3.0/api/puppeteer.frame.isoopframe.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.frame.isoopframe.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.frame.isoopframe.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.frame.locator.md b/website/versioned_docs/version-21.3.0/api/puppeteer.frame.locator.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.frame.locator.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.frame.locator.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.frame.locator_1.md b/website/versioned_docs/version-21.3.0/api/puppeteer.frame.locator_1.md similarity index 100% rename from website/versioned_docs/version-21.2.1/api/puppeteer.frame.locator_1.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.frame.locator_1.md diff --git a/website/versioned_docs/version-21.2.1/api/puppeteer.frame.md b/website/versioned_docs/version-21.3.0/api/puppeteer.frame.md similarity index 97% rename from website/versioned_docs/version-21.2.1/api/puppeteer.frame.md rename to website/versioned_docs/version-21.3.0/api/puppeteer.frame.md index 425c436a571..1254fbc1e7e 100644 --- a/website/versioned_docs/version-21.2.1/api/puppeteer.frame.md +++ b/website/versioned_docs/version-21.3.0/api/puppeteer.frame.md @@ -11,16 +11,16 @@ To understand frames, you can think of frames as `