Issue metadata
Sign in to add a comment
|
Notification API has no way of distinguishing between notifications denied or permission request blocked.
Reported by
martijnj...@gmail.com,
Oct 10
|
||||||||||||||||||||||
Issue descriptionChrome Version : 69.0.3497.100 Relating: https://www.chromestatus.com/feature/6451284559265792 The case where notification permission requests are blocked, because the page is embedded in an iframe, is not reflected in the API. Through the API it just looks like the user denied notifications, which leads to apps not being able to act accordingly.
,
Oct 11
I have an open pull request on the notifications spec partially covering this at https://github.com/whatwg/notifications/pull/121. I don't really see why we need to expose this through any web-facing APIs. The spec should simply move to saying that notifications are not allowed in non-top-level, non-secure contexts.
,
Oct 11
#c1 - UI>Notifications captures both. If all other browsers agree with restricting the permission requests to top-level, secure-context pages, then it should be fairly straightforward to land the spec change. AFAIK Mozilla doesn't, though, at least in their implementation. Let me assign this to myself.
,
Oct 11
I take it you miss spoke and are referring to notification permission requests and not notifications themselves to be disallowed at non-top-level. We shouldn't mix up this situation with the dis-allowance of notifications from non-secure contexts. Because those are never allowed through Blink. https://www.chromestatus.com/feature/5759967025954816 Embedded pages are still allowed to create notifications, they are just required to get the permission as a top level page. So `denied` might reflect the state for non-secure contexts, but it doesn't for embedded ones. Btw, could you point me to the whatwg discussion on the topic.
,
Oct 11
Is your concern that the initial state for Notification.permission is "denied" for non-top-level pages, where "default" would be returned for a top-level page? We'd like the result of querying permission state (e.g. Notification.permission & permissions.query()) to be "denied" when requesting the permission is going to be automatically denied too. The reason for automatically denying the permission can by due to various browser-level heuristics, which can't all be captured by the standard. What is the specific use-case you're looking to address with this knowledge? Requesting any permission in a top-level frame is always going to be more clear to your users, because it gives them significantly more context on what they're agreeing to.
,
Oct 11
> Is your concern that the initial state for Notification.permission is "denied" for non-top-level pages, where "default" would be returned for a top-level page? Yes. The proposed way of handling a permission request from an iframe is to spawn a new top window page. But there might be situations where you don't want to bother the user in this way if the user has already denied notifications. But currently you need to always spawn the window to derive the actual state. > Requesting any permission in a top-level frame is always going to be more clear to your users, because it gives them significantly more context on what they're agreeing to. This is a bit besides the point, I'm not sure I agree. I would say that there are plenty other UI/UX techniques for making the origin clear that rival a popup. Also, I think it makes revoking permissions for an embedded page more problematic for the user.
,
Oct 14
,
Oct 15
|
|||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||
Comment 1 by jstenback@chromium.org
, Oct 10