feat: add durableStorage to allowed permissions (#5295)

This commit is contained in:
Max White 2021-09-16 11:35:36 +01:00 committed by GitHub
parent 54c4318016
commit eda5171279
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 0 deletions

View File

@ -1094,6 +1094,7 @@ Creates a new page in the browser context.
- `'clipboard-read'`
- `'clipboard-write'`
- `'payment-handler'`
- `'persistent-storage'`
- returns: <[Promise]>
```js

View File

@ -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';

View File

@ -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 () {