2020-06-04 14:56:45 +00:00
|
|
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
|
|
|
|
|
|
[Home](./index.md) > [puppeteer](./puppeteer.md) > [BrowserContext](./puppeteer.browsercontext.md) > [overridePermissions](./puppeteer.browsercontext.overridepermissions.md)
|
|
|
|
|
|
|
|
## BrowserContext.overridePermissions() method
|
|
|
|
|
|
|
|
<b>Signature:</b>
|
|
|
|
|
|
|
|
```typescript
|
2020-10-01 06:24:47 +00:00
|
|
|
overridePermissions(origin: string, permissions: string[]): Promise<void>;
|
2020-06-04 14:56:45 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
## Parameters
|
|
|
|
|
|
|
|
| Parameter | Type | Description |
|
|
|
|
| --- | --- | --- |
|
2020-06-23 05:21:01 +00:00
|
|
|
| origin | string | The origin to grant permissions to, e.g. "https://example.com". |
|
2020-10-01 06:24:47 +00:00
|
|
|
| permissions | string\[\] | An array of permissions to grant. All permissions that are not listed here will be automatically denied. |
|
2020-06-04 14:56:45 +00:00
|
|
|
|
|
|
|
<b>Returns:</b>
|
|
|
|
|
|
|
|
Promise<void>
|
|
|
|
|
2020-06-23 05:21:01 +00:00
|
|
|
## Example
|
|
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
const context = browser.defaultBrowserContext();
|
|
|
|
await context.overridePermissions('https://html5demos.com', ['geolocation']);
|
|
|
|
|
|
|
|
```
|
|
|
|
|