From bb37df5f6470f7a32481e83e603ebbe8bac69ed8 Mon Sep 17 00:00:00 2001
From: Nikolay Vitkov <34244704+Lightning00Blade@users.noreply.github.com>
Date: Mon, 27 Mar 2023 13:16:51 +0200
Subject: [PATCH] docs: add DeviceRequestPrompt documentation (#9918)
---
docs/api/index.md | 70 ++++++++++---------
.../puppeteer.devicerequestprompt.cancel.md | 19 +++++
.../puppeteer.devicerequestprompt.devices.md | 15 ++++
docs/api/puppeteer.devicerequestprompt.md | 45 ++++++++++++
.../puppeteer.devicerequestprompt.select.md | 25 +++++++
...eteer.devicerequestprompt.waitfordevice.md | 29 ++++++++
.../puppeteer.devicerequestpromptdevice.id.md | 15 ++++
.../puppeteer.devicerequestpromptdevice.md | 24 +++++++
...uppeteer.devicerequestpromptdevice.name.md | 15 ++++
.../puppeteer.frame.waitfordeviceprompt.md | 2 +-
.../api/puppeteer.page.waitfordeviceprompt.md | 2 +-
.../src/common/NetworkManager.ts | 13 +---
packages/puppeteer-core/src/common/Page.ts | 2 +-
packages/puppeteer-core/src/common/common.ts | 1 +
14 files changed, 230 insertions(+), 47 deletions(-)
create mode 100644 docs/api/puppeteer.devicerequestprompt.cancel.md
create mode 100644 docs/api/puppeteer.devicerequestprompt.devices.md
create mode 100644 docs/api/puppeteer.devicerequestprompt.md
create mode 100644 docs/api/puppeteer.devicerequestprompt.select.md
create mode 100644 docs/api/puppeteer.devicerequestprompt.waitfordevice.md
create mode 100644 docs/api/puppeteer.devicerequestpromptdevice.id.md
create mode 100644 docs/api/puppeteer.devicerequestpromptdevice.md
create mode 100644 docs/api/puppeteer.devicerequestpromptdevice.name.md
diff --git a/docs/api/index.md b/docs/api/index.md
index dfbd20ef01a..735ce4e6776 100644
--- a/docs/api/index.md
+++ b/docs/api/index.md
@@ -6,40 +6,42 @@ sidebar_label: API
## Classes
-| Class | Description |
-| ------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| [Accessibility](./puppeteer.accessibility.md) | The Accessibility class provides methods for inspecting Chromium's accessibility tree. The accessibility tree is used by assistive technology such as [screen readers](https://en.wikipedia.org/wiki/Screen_reader) or [switches](https://en.wikipedia.org/wiki/Switch_access). |
-| [Browser](./puppeteer.browser.md) | A Browser is created when Puppeteer connects to a Chromium instance, either through [PuppeteerNode.launch()](./puppeteer.puppeteernode.launch.md) or [Puppeteer.connect()](./puppeteer.puppeteer.connect.md). |
-| [BrowserContext](./puppeteer.browsercontext.md) | BrowserContexts provide a way to operate multiple independent browser sessions. When a browser is launched, it has a single BrowserContext used by default. The method [Browser.newPage](./puppeteer.browser.newpage.md) creates a page in the default browser context. |
-| [BrowserFetcher](./puppeteer.browserfetcher.md) | BrowserFetcher can download and manage different versions of Chromium and Firefox. |
-| [CDPSession](./puppeteer.cdpsession.md) | The CDPSession
instances are used to talk raw Chrome Devtools Protocol. |
-| [Connection](./puppeteer.connection.md) | |
-| [ConsoleMessage](./puppeteer.consolemessage.md) | ConsoleMessage objects are dispatched by page via the 'console' event. |
-| [Coverage](./puppeteer.coverage.md) | The Coverage class provides methods to gathers information about parts of JavaScript and CSS that were used by the page. |
-| [CSSCoverage](./puppeteer.csscoverage.md) | |
-| [CustomError](./puppeteer.customerror.md) | |
-| [Dialog](./puppeteer.dialog.md) | Dialog instances are dispatched by the [Page](./puppeteer.page.md) via the dialog
event. |
-| [ElementHandle](./puppeteer.elementhandle.md) | ElementHandle represents an in-page DOM element. |
-| [EventEmitter](./puppeteer.eventemitter.md) | The EventEmitter class that many Puppeteer classes extend. |
-| [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.
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. | -| [Mouse](./puppeteer.mouse.md) | The Mouse class operates in main-frame CSS pixels relative to the top-left corner of the viewport. | -| [Page](./puppeteer.page.md) |Page provides methods to interact with a single tab or [extension background page](https://developer.chrome.com/extensions/background_pages) in Chromium.
:::note
One Browser instance might have multiple Page instances.
:::
| -| [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).
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
).
CDPSession
instances are used to talk raw Chrome Devtools Protocol. |
+| [Connection](./puppeteer.connection.md) | |
+| [ConsoleMessage](./puppeteer.consolemessage.md) | ConsoleMessage objects are dispatched by page via the 'console' event. |
+| [Coverage](./puppeteer.coverage.md) | The Coverage class provides methods to gathers information about parts of JavaScript and CSS that were used by the page. |
+| [CSSCoverage](./puppeteer.csscoverage.md) | |
+| [CustomError](./puppeteer.customerror.md) | |
+| [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.
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. | +| [Mouse](./puppeteer.mouse.md) | The Mouse class operates in main-frame CSS pixels relative to the top-left corner of the viewport. | +| [Page](./puppeteer.page.md) |Page provides methods to interact with a single tab or [extension background page](https://developer.chrome.com/extensions/background_pages) in Chromium.
:::note
One Browser instance might have multiple Page instances.
:::
| +| [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).
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
).