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-write'`
|
||||
- `'payment-handler'`
|
||||
- `'persistent-storage'`
|
||||
- returns: <[Promise]>
|
||||
|
||||
```js
|
||||
|
@ -56,6 +56,7 @@ const WEB_PERMISSION_TO_PROTOCOL_PERMISSION = new Map<
|
||||
['clipboard-read', 'clipboardReadWrite'],
|
||||
['clipboard-write', 'clipboardReadWrite'],
|
||||
['payment-handler', 'paymentHandler'],
|
||||
['persistent-storage', 'durableStorage'],
|
||||
['idle-detection', 'idleDetection'],
|
||||
// chrome-specific permissions we have.
|
||||
['midi-sysex', 'midiSysex'],
|
||||
@ -79,6 +80,7 @@ export type Permission =
|
||||
| 'clipboard-read'
|
||||
| 'clipboard-write'
|
||||
| 'payment-handler'
|
||||
| 'persistent-storage'
|
||||
| 'idle-detection'
|
||||
| 'midi-sysex';
|
||||
|
||||
|
@ -339,6 +339,18 @@ describe('Page', function () {
|
||||
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 () {
|
||||
|
Loading…
Reference in New Issue
Block a user