DescriptionAllow the embedder to disable the Notification constructor.
On desktop platforms, we're shipping both "page" (non-persistent)
notifications and Service Worker-based Notifications. On Android,
we're only shipping Service Worker-based Notifications. Allow the
embedder to enforce this decision.
Non-persistent notifications have their event handler on the JavaScript
object constructed by "new Notifications()". We cannot reliably support
these notifications on Android, and they will lead to a bad user
experience because pages can be killed in the background at any time.
The specification is moving towards non-persistent notifications to be
true temporary ones, auto-dismissing themselves after a few seconds.
This has not been decided upon yet, however.
In the following GitHub issue on the Notification specification, Anne
agrees that it's fine to ship one, and not the other.
https://github.com/whatwg/notifications/issues/26
Android has never shipped this, and the Service Workers-based Notification
intent scopes to the ServiceWorkerRegistration.showNotification() function.
This patch does not impact functionality on desktop. We implement the
restriction by throwing a type error upon constructor invocation.
Note that the Notification object still has to be exposed on the global, for
the "permission" property and the "requestPermission" function to be usable.
This is part of a two-sided patch:
[1] This patch.
[2] https://codereview.chromium.org/920153002
BUG=441828
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=190152
Patch Set 1 #
Messages
Total messages: 9 (2 generated)
|