docs: note that permissions list may change (#33690)

This commit is contained in:
Dmitry Gozman 2024-11-20 14:08:34 +00:00 committed by GitHub
parent 1afb56ee1b
commit 94776ad18a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 13 additions and 5 deletions

View File

@ -963,9 +963,14 @@ specified.
* since: v1.8
- `permissions` <[Array]<[string]>>
A permission or an array of permissions to grant. Permissions can be one of the following values:
A list of permissions to grant.
:::danger
Supported permissions differ between browsers, and even between different versions of the same browser. Any permission may stop working after an update.
:::
Here are some permissions that may be supported by some browsers:
* `'accelerometer'`
* `'accessibility-events'`
* `'ambient-light-sensor'`
* `'background-sync'`
* `'camera'`

View File

@ -428,7 +428,6 @@ export class CRBrowserContext extends BrowserContext {
['accelerometer', 'sensors'],
['gyroscope', 'sensors'],
['magnetometer', 'sensors'],
['accessibility-events', 'accessibilityEvents'],
['clipboard-read', 'clipboardReadWrite'],
['clipboard-write', 'clipboardSanitizedWrite'],
['payment-handler', 'paymentHandler'],

View File

@ -8961,9 +8961,13 @@ export interface BrowserContext {
/**
* Grants specified permissions to the browser context. Only grants corresponding permissions to the given origin if
* specified.
* @param permissions A permission or an array of permissions to grant. Permissions can be one of the following values:
* @param permissions A list of permissions to grant.
*
* **NOTE** Supported permissions differ between browsers, and even between different versions of the same browser.
* Any permission may stop working after an update.
*
* Here are some permissions that may be supported by some browsers:
* - `'accelerometer'`
* - `'accessibility-events'`
* - `'ambient-light-sensor'`
* - `'background-sync'`
* - `'camera'`