New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 894041 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug
Team-Security-UX



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 description

Chrome 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.

 
Status: Available (was: Unconfirmed)
Confirming this issue. We should bring this up in the spec and figure out how to deal with this one. Leaving this in the Blink component as we don't have a dedicated component for the notification API (and this is not about the notifications UI, for which we have a component).
Components: -Blink UI>Notifications
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.
Owner: peter@chromium.org
Status: Assigned (was: Available)
#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.
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.
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.
> 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.
Cc: engedy@chromium.org
Components: Internals>Permissions>Model UI>Browser>Permissions>Prompts

Sign in to add a comment