From 94776ad18affbd41a7b25d29101dba2187092cd4 Mon Sep 17 00:00:00 2001 From: Dmitry Gozman Date: Wed, 20 Nov 2024 14:08:34 +0000 Subject: [PATCH] docs: note that permissions list may change (#33690) --- docs/src/api/class-browsercontext.md | 9 +++++++-- .../playwright-core/src/server/chromium/crBrowser.ts | 1 - packages/playwright-core/types/types.d.ts | 8 ++++++-- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/docs/src/api/class-browsercontext.md b/docs/src/api/class-browsercontext.md index 8d6c57a3e3..121ce1fdf6 100644 --- a/docs/src/api/class-browsercontext.md +++ b/docs/src/api/class-browsercontext.md @@ -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'` diff --git a/packages/playwright-core/src/server/chromium/crBrowser.ts b/packages/playwright-core/src/server/chromium/crBrowser.ts index e0409c1b16..a6d77e4ae7 100644 --- a/packages/playwright-core/src/server/chromium/crBrowser.ts +++ b/packages/playwright-core/src/server/chromium/crBrowser.ts @@ -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'], diff --git a/packages/playwright-core/types/types.d.ts b/packages/playwright-core/types/types.d.ts index 865fd0cb7c..d7e3a4f36a 100644 --- a/packages/playwright-core/types/types.d.ts +++ b/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'`