Skip to main content
Version: 23.9.0

BrowserContext.clearPermissionOverrides() 方法

¥BrowserContext.clearPermissionOverrides() method

清除此 浏览器上下文 的所有权限覆盖。

¥Clears all permission overrides for this browser context.

签名

¥Signature

class BrowserContext {
abstract clearPermissionOverrides(): Promise<void>;
}

Returns:

Promise<void>

示例

¥Example

清除 默认浏览器上下文 中覆盖的权限:

¥Clearing overridden permissions in the default browser context:

const context = browser.defaultBrowserContext();
context.overridePermissions('https://example.com', ['clipboard-read']);
// do stuff ..
context.clearPermissionOverrides();