-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Closed
Labels
Description
Steps to reproduce
- Puppeteer version: 1.8.0
- Platform / OS version: macOS 10.3.6
- Node.js version: 8.12.0
What steps will reproduce the problem?
I'm trying to allow push notifications in headless chrome with puppeteer. It was implemented in #846
After I call overridePermissions the Notification.requestPermission(); call returns me desired result - 'granted'. But Notification.permission still returns 'denied', but it should be 'granted' too.
Here is the code:
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch();
const context = browser.defaultBrowserContext();
const page = await browser.newPage();
await page.goto('https://serviceworke.rs/push-simple_demo.html');
console.log(await page.evaluate(function(){return Notification.requestPermission();}));
console.log(await page.evaluate(function(){return Notification.permission;}));
await context.overridePermissions('https://serviceworke.rs', ['notifications']);
await page.goto('https://serviceworke.rs/push-simple_demo.html');
console.log(await page.evaluate(function(){return Notification.requestPermission();}));
console.log(await page.evaluate(function(){return Notification.permission;}));
await browser.close();
})();What is the expected result?
default
denied
granted
granted
What happens instead?
default
denied
granted
denied
rroughton, kylewill, sjchmiela, neekey, markapruett and 3 more