WaPo push notification does not open Chrome/Page |
||
Issue descriptionChrome Version: 57.0.2983.0 OS: Android 7.1.1 [It's possible this is an external issue] I received a push notification from washingtonpost.com inside of Chrome Canary. Clicking on it did not bring up Chrome Canary, nor navigated to the page that it was talking about. I have not dug in to see if this is a regression in Chrome, an issue with how Washington Post is using notifications, or something else.
,
Jan 27 2017
The issue has been fixed. |
||
►
Sign in to add a comment |
||
Comment 1 by peter@chromium.org
, Jan 24 2017Components: UI>Notifications Blink>PushAPI
Owner: peter@chromium.org
Status: ExternalDependency (was: Untriaged)
Their Service Worker code is here: https://www.washingtonpost.com/sw.js I notice the issue that's definitely causing this bug, as well as one peculiarity. The issue is that they assume the Service Worker will remain alive between the `push` and the `notificationclick` events. The |notification_data| global is populated in the `push` event after receiving a message, and is read in the `notificationclick` event. In reality, you can never rely on the lifetime of a Service Worker and it's global scope. We'll forcefully shut it down after a few minutes at most, so if the user sees the notification after that (which is very likely on Android) it'll have a clean global state. This causes a JavaScript error in the following assignment in the `notificationclick` event: > var contentURL = notification_data[0].contentURL Which, in turn, neither closes the notification (which is done after), nor focuses or opens a new window. The peculiarity I notice is that they delay the `notificationclick` event by 500ms through a setTimeout(). Why? That just degrades the user experience. Maybe they ran into a race condition that we're not aware of?