mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
feat: add durableStorage to allowed permissions (#5295)
This commit is contained in:
parent
54c4318016
commit
eda5171279
@ -1094,6 +1094,7 @@ Creates a new page in the browser context.
|
|||||||
- `'clipboard-read'`
|
- `'clipboard-read'`
|
||||||
- `'clipboard-write'`
|
- `'clipboard-write'`
|
||||||
- `'payment-handler'`
|
- `'payment-handler'`
|
||||||
|
- `'persistent-storage'`
|
||||||
- returns: <[Promise]>
|
- returns: <[Promise]>
|
||||||
|
|
||||||
```js
|
```js
|
||||||
|
@ -56,6 +56,7 @@ const WEB_PERMISSION_TO_PROTOCOL_PERMISSION = new Map<
|
|||||||
['clipboard-read', 'clipboardReadWrite'],
|
['clipboard-read', 'clipboardReadWrite'],
|
||||||
['clipboard-write', 'clipboardReadWrite'],
|
['clipboard-write', 'clipboardReadWrite'],
|
||||||
['payment-handler', 'paymentHandler'],
|
['payment-handler', 'paymentHandler'],
|
||||||
|
['persistent-storage', 'durableStorage'],
|
||||||
['idle-detection', 'idleDetection'],
|
['idle-detection', 'idleDetection'],
|
||||||
// chrome-specific permissions we have.
|
// chrome-specific permissions we have.
|
||||||
['midi-sysex', 'midiSysex'],
|
['midi-sysex', 'midiSysex'],
|
||||||
@ -79,6 +80,7 @@ export type Permission =
|
|||||||
| 'clipboard-read'
|
| 'clipboard-read'
|
||||||
| 'clipboard-write'
|
| 'clipboard-write'
|
||||||
| 'payment-handler'
|
| 'payment-handler'
|
||||||
|
| 'persistent-storage'
|
||||||
| 'idle-detection'
|
| 'idle-detection'
|
||||||
| 'midi-sysex';
|
| 'midi-sysex';
|
||||||
|
|
||||||
|
@ -339,6 +339,18 @@ describe('Page', function () {
|
|||||||
await otherContext.close();
|
await otherContext.close();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
itFailsFirefox('should grant persistent-storage', async () => {
|
||||||
|
const { page, server, context } = getTestState();
|
||||||
|
|
||||||
|
await page.goto(server.EMPTY_PAGE);
|
||||||
|
expect(await getPermission(page, 'persistent-storage')).not.toBe(
|
||||||
|
'granted'
|
||||||
|
);
|
||||||
|
await context.overridePermissions(server.EMPTY_PAGE, [
|
||||||
|
'persistent-storage',
|
||||||
|
]);
|
||||||
|
expect(await getPermission(page, 'persistent-storage')).toBe('granted');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Page.setGeolocation', function () {
|
describe('Page.setGeolocation', function () {
|
||||||
|
Loading…
Reference in New Issue
Block a user