[BUG] [WebKit] The browser is appearing and asking to allow 'website' to use your camera and microphone, after running it in headless mode.
See original GitHub issueContext:
- Playwright Version: [1.7.1]
- Operating System: [Mac]
- Node.js version: [12.18.3]
- Browser: [WebKit]
- Extra: [macOS Catalina 10.15.7]
pw:api => browserType.launch started +0ms
pw:api <= browserType.launch succeeded +118ms
pw:api => browser.newContext started +0ms
pw:api <= browser.newContext succeeded +24ms
pw:api => browserContext.newPage started +0ms
pw:api <= browserContext.newPage succeeded +155ms
pw:api => page.goto started +0ms
pw:api navigating to "https://appr.tc/", waiting until "load" +1ms
pw:api navigated to "https://appr.tc/" +304ms
pw:api "domcontentloaded" event fired +272ms
pw:api "load" event fired +131ms
pw:api <= page.goto succeeded +0ms
pw:api => page.click started +0ms
pw:api waiting for selector "#join-button" +3ms
pw:api selector resolved to visible <button id="join-button">JOIN</button> +22ms
pw:api attempting click action +2ms
pw:api waiting for element to be visible, enabled and not moving +0ms
pw:api element is visible, enabled and does not move +26ms
pw:api scrolling into view if needed +0ms
pw:api done scrolling +1ms
pw:api checking that element receives pointer events at (511.19,240.35) +2ms
pw:api element does receive pointer events +2ms
pw:api performing click action +0ms
pw:api click action done +348ms
pw:api waiting for scheduled navigations to finish +0ms
pw:api navigations have finished +0ms
pw:api <= page.click succeeded +1ms
pw:api "networkidle" event fired +505ms
System:
OS: macOS 10.15.7
Memory: 98.62 MB / 16.00 GB
Binaries:
Node: 12.18.3 - ~/.nvm/versions/node/v12.18.3/bin/node
npm: 6.14.6 - ~/.nvm/versions/node/v12.18.3/bin/npm
Languages:
Bash: 3.2.57 - /bin/bash
Code Snippet
const { webkit } = require('playwright');
(async () => {
const browser = await webkit.launch();
const page = await browser.newPage();
await page.goto('https://appr.tc/');
await page.click('#join-button');
})();
Describe the bug The browser is appearing and asking to allow ‘website’ to use your camera and microphone, after running it in headless mode.
Here is the screenshot in headless mode
NOTE: In headed mode, the browser doesn’t ask you for these permissions and a fake video stream works by default without providing any arguments or granting permissions.
Here is the screenshot in headed mode
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:11 (7 by maintainers)
Top Results From Across the Web
Use your camera & microphone - Google Chrome Help
Open Chrome Chrome . Go to a site that wants to use your microphone and camera. When prompted, choose Allow or Block. Allowed...
Read more >How do I grant permission for Camera and Microphone in my ...
Right-click anywhere in the browser, and click "View Page Info". Under the Permissions tab, find Use the Camera and Use the Microphone sections ......
Read more >Hi, My selenium script is not working on headless mode but ...
Some of the applications do not work properly in the headless mode due to the application firewall. In that case, you need to...
Read more >Puppeteer documentation - DevDocs
The following is code for getting a handle to the background page of an extension whose ... headless <boolean> Whether to run browser...
Read more >flutter_inappwebview 5.0.5 | Flutter Package - Pub.dev
A Flutter plugin that allows you to add an inline webview, to use an headless webview, and to open an in-app browser window....
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 FreeTop 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
Top GitHub Comments
We currently don’t support camera and microphone permissions in webkit. It’s particularly hard in webkit because the implementation differs a lot between platforms (doesn’t work on Windows for example) so we are not ready to add them at the moment. Without such permissions it’s not clear what a meaningful fix for this bug would be, we could suppress the dialog and simply dismiss the dialog but that would fix just one step in the testing scenario and it still wouldn’t be possible to test webrtc in a sensible way. Considering little value of just suppressing the dialog I’m leaving this issue open until we decide to work on a more comprehensive support for webrtc (tracked in #2973).
@pavelfeldman I saw you closed this issue but we have not found a work-around. We have a app that requires these permissions and we’d like to test it with Playwright. Currently, we are using Protractor with Safari on Mac with BrowserStack and there are no issues there. Can you consider re-opening this and addressing it?