[BUG] browser.newContext: Unknown permission: clipboard-read for webkit
See original GitHub issueContext:
- Playwright Version: 1.20.1
- Operating System: Mac
- Node.js version: 14.6
- Browser: webkit
Code Snippet
const config: PlaywrightTestConfig = {
globalTeardown: require.resolve('../src/utils/teardown'),
workers: configList.workers,
use: {
contextOptions: {
userAgent: configList.userAgent,
permissions: ['clipboard-read', 'clipboard-write']
},
test('test', async ({ browserName, page }) => {
expect(await page.screenshot({ fullPage: true, timeout: 4000 })).toMatchSnapshot(`${browserName}-EN.png`);
});
Describe the bug
Test is failing for webkit browser, if config file contains permissions: ['clipboard-read', 'clipboard-write'] however there is not any clipboard event is being used in this test
error :
3) [Desktop Firefox] › search/.test.ts:38:5 › Landing page Test Suite › test
browser.newContext: Unknown permission: clipboard-read
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:8 (2 by maintainers)
Top Results From Across the Web
Browser | Playwright - CukeTest
In a newly created browser, this will return zero browser contexts. const browser = await pw.webkit.
Read more >BrowserContext (Playwright - Main Library 1.12.1 API)
Clears all permission overrides for the browser context. BrowserContext context = browser.newContext(); context.grantPermissions(Arrays.asList("clipboard-read")); ...
Read more >mozilla-central: changeset 463200 ...
Find changesets by keywords (author, files, the commit message), revision number or hash, or revset expression. bug 1523104: remote: add browser mochitest to ......
Read more >All the Electron Docs! | Electron
Electron is an open source library developed by GitHub for building cross-platform desktop applications with HTML, CSS, and JavaScript. Electron accomplishes ...
Read more >Index - Web APIs
# Page Tags and summary
1 Web APIs. ⚠️ API, DOM, Landing, Reference, Web
2 ANGLE_instanced_arrays. ⚠️ API, Reference, WebGL, WebGL extension
13 AbortSignal: abort event....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

We suggest to set permission per browser. Most likely, you already have test projects with different browsers configured, so just move
permissionto the respective project.I had the same issue in Firefox, CodeceptJS + Playwright. In Firefox no permission is needed to have working “copy of text to clipboard” (note it works in secure sites only).
It would be great if Playwright was able to suppress the error
browser.newContext: Unknown permission: clipboard-writeif given browser doesn’t provide that feature. Currently I must allow such setting in test for Chromium and not for Firefox which makes tests more complex.