> Would it still be possible to explicitly request permission from within a Service Worker registration?
I'm not sure how that would work, actually -- at least it's not the model other APIs follow. The `Notifications` interface isn't exposed in service workers, only on `window` [Notifications Spec](https://notifications.spec.whatwg.org/#api).
It seems to me that the main (only?) use case for calling `requestPermission` here would be when a user visits a page on an origin and wants to grant that origin the ability to handle payments for them. I may be misunderstanding, but what's the use case for requesting permission in a service worker instead of on the page directly -- when the user has it in front of them?
As the service worker runs in the background, when would it run `requestPermission`? It would have to be triggered by an event that the service worker can respond to (`install`, `activate`, `message`?). If the service worker detected it needed permission from the user, couldn't it open a client window (or focus one) and tell it to request permission? Perhaps having a page from the origin in front of the user should even be a requirement for getting permission as it helps them understand what's going on.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webpayments-payment-apps-api/issues/94#issuecomment-285090328