Chrome Version: 71.0.3542.0 (Developer Build) (64-bit)
OS: all
Puppeteer downstream issue: https://github.com/GoogleChrome/puppeteer/issues/3241
What steps will reproduce the problem?
(1) Run the code below.
What is the expected result?
Chrome has already been granted camera permission through protocol API so the getUserMedia demo should just start working and there should be no permission dialog.
What happens instead?
The scripts clicks the "Open camera" button for the user and Chrome still prompts to allow camera access.
const URL = require('url').URL;
const url = new URL('https://webrtc.github.io/samples/src/content/getusermedia/gum/');
const browser = await puppeteer.launch({headless: false});
const context = browser.defaultBrowserContext();
context.clearPermissionOverrides();
context.overridePermissions(url.origin, ['camera']);
const page = await context.newPage();
await page.goto(url.href);
const granted = await page.evaluate(async () => {
return (await navigator.permissions.query({name: 'camera'})).state;
});
console.log('Granted:', granted);
await page.$eval('#showVideo', el => el.click()); // clicks the "open camera' button
Comment 1 by lushnikov@chromium.org
, Dec 19