Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(354)

Issue 901843006: Allow the embedder to disable the Notification constructor. (Closed)

Created:
5 years, 10 months ago by Peter Beverloo
Modified:
5 years, 10 months ago
Reviewers:
Mike West
CC:
blink-reviews, dglazkov+blink
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Allow 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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+19 lines, -2 lines) Patch
M Source/modules/notifications/Notification.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/modules/notifications/Notification.cpp View 2 chunks +9 lines, -1 line 0 comments Download
M Source/modules/notifications/Notification.idl View 1 chunk +1 line, -0 lines 0 comments Download
M Source/platform/RuntimeEnabledFeatures.in View 1 chunk +1 line, -0 lines 0 comments Download
M Source/web/WebRuntimeFeatures.cpp View 1 chunk +5 lines, -0 lines 0 comments Download
M public/web/WebRuntimeFeatures.h View 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 9 (2 generated)
Peter Beverloo
+mkwst What do you think? Given the very low usage of Web Notifications (UMA on ...
5 years, 10 months ago (2015-02-12 21:39:51 UTC) #2
Mike West
Intent to Remove? This LGTM, once you've gotten the API owners to sign off on ...
5 years, 10 months ago (2015-02-13 04:51:43 UTC) #3
Peter Beverloo
On 2015/02/13 04:51:43, Mike West wrote: > Intent to Remove? > > This LGTM, once ...
5 years, 10 months ago (2015-02-13 14:27:08 UTC) #4
Peter Beverloo
On 2015/02/13 14:27:08, Peter Beverloo wrote: > I have clarified the description to put more ...
5 years, 10 months ago (2015-02-13 14:40:27 UTC) #5
Peter Beverloo
On 2015/02/13 14:40:27, Peter Beverloo wrote: > On 2015/02/13 14:27:08, Peter Beverloo wrote: > > ...
5 years, 10 months ago (2015-02-13 15:32:50 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/901843006/1
5 years, 10 months ago (2015-02-13 15:33:50 UTC) #8
commit-bot: I haz the power
5 years, 10 months ago (2015-02-13 15:36:52 UTC) #9
Message was sent while issue was closed.
Committed patchset #1 (id:1) as
https://src.chromium.org/viewvc/blink?view=rev&revision=190152

Powered by Google App Engine
This is Rietveld 408576698