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

This commit is contained in:
Dmitry Gozman 2024-11-20 14:08:34 +00:00 коммит произвёл GitHub
Родитель 1afb56ee1b
Коммит 94776ad18a
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
3 изменённых файлов: 13 добавлений и 5 удалений

Просмотреть файл

@ -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'`

Просмотреть файл

@ -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'],

8
packages/playwright-core/types/types.d.ts поставляемый
Просмотреть файл

@ -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'`