Intent to Deprecate and Remove: requesting notification permission from iframes
Primary eng (and PM) emails
Summary
Remove the ability to call Notification.requestPermission() from non-main frames.
It is intended to align this with the deprecation and removal of access to the Notifications API over insecure connections, which will be deprecated in M58 and removed in M60.
Motivation
This change will completely align the requirements for notification permission with that of push notifications, easing friction for developers. It also allows us to unify notification and push permissions.
More generally, permission requests from iframes cause significant confusion for users. It is difficult to distinguish between the main frame origin and the origin requesting the permission. The scope of the permission decision (within or outside an iframe) is also unclear, making it difficult to reason about when a granted or denied permission takes effect.
Compatibility Risk
Notification.requestPermission() from an iframe is commonly used to allow push aggregation services to work on insecure origins. This is because the push API requires HTTPS, and cannot be instantiated from an iframe without prior push or notifications permission being granted.
The aggregator provides a secure iframe which requests notification permission; if it is granted, the HTTPS aggregator may then use the notification permission to send push notifications on behalf of the HTTP site through their own origin. Major push aggregators were contacted for feedback on this change, and no strong objections were made. It was requested that this change should align with the removal of the Notifications API from HTTP if possible.
Alternative implementation suggestion for web developers
Instead of using an iframe, affected websites can open a new window (i.e. a new main frame) to request notification permission. One group has already experimented with this flow and found that it did not significantly impact acceptance rates.
Usage information from UseCounter
An early metric (currently on Canary for M58) pegs the use of Notification.requestPermission() from iframes at 0.0003%.
The Notification constructor is called from secure cross-origin iframes on 0.0009% of page loads. It is called from insecure cross-origin iframes on 0.0029% of page loads, but this will be restricted by the upcoming removal of access to the Notifications API on HTTP.
Notification.requestPermission() from iframes: 0.0003%
(https://www.chromestatus.com/metrics/feature/popularity#NotificationPermissionRequestedIframe)
Secure origin iframes: 0.0009% (https://www.chromestatus.com/metrics/feature/popularity#NotificationAPISecureOriginIframe)
Insecure origin iframes: 0.0029%
(https://www.chromestatus.com/metrics/feature/popularity#NotificationAPIInsecureOriginIframe)
OWP launch tracking bug
https://bugs.chromium.org/p/chromium/issues/detail?id=695693
Entry on the feature dashboard
https://www.chromestatus.com/feature/6451284559265792
Requesting approval to remove too?
Yes. We plan to add a console warning in M58, with full restriction in M60. This aligns with the restriction of the Notifications API to secure origins.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
LGTM2
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
This needs to be revisited. Denial of login permission results in continuous future requests for permission, upon every reboot. For those not interested in granting login access permission this is a problem.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/144d01ac-cb22-4828-8ec9-f98253227bd0%40chromium.org.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/f6074400-52f0-4ecd-a286-8cba6468ce0b%40chromium.org.
ckaczor: Yes, this applies only to *requesting* permission, not creating Notifications once you have permission. When you have acquired permission in the main frame, you may create a notification from any iframe hosted on that same origin.We haven't yet landed the code to disable requesting in Canary, but this should happen quite soon.
On 12 July 2017 at 05:35, <cka...@vertical.com> wrote:
Just to clarify - this only covers requesting notification permission, not actually creating/showing a notification once permission has been granted?At a high level our application uses an iframe to host sub-applications and some of the sub-applications use notifications. If we move the notification permission request up to the main application can we leave the notification code itself in the sub-applications?I tried testing this with 61.0.3141.7 and all notifications worked normally so it seems like it hasn't been removed yet?Thanks!
On Monday, February 27, 2017 at 8:00:20 PM UTC-5, Dominick Ng wrote:
Intent to Deprecate and Remove: requesting notification permission from iframes
Primary eng (and PM) emails
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/77a0537e-7710-4224-9b8a-7def63b08405%40chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAOLd7fFmv69DY7f_3Fffz8Nkix2WvaNmVZw-gf58GsLvVBamnQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAG_kaUYOQWSsMxEEsdGjT%3DPK0q-ONhBTMUGW_s8OhC7soPmc8Q%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/ef9ac3aa-8634-4637-9220-92e6d52d0ce6%40chromium.org.