Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Push API should recommend implementing ServiceWorkerRegistration.showNotification #118

Closed
johnmellor opened this issue Mar 2, 2015 · 2 comments

Comments

@johnmellor
Copy link
Contributor

Web developers using the Push API, and subscribing from a document context, will typically check !!window.Notification to see whether the Notifications API is implemented, since they cannot easily check from a document context whether the Notifications Service Worker API (especially ServiceWorkerRegistration.showNotification and ServiceWorkerGlobalScope.onnotificationclick) is implemented.

Thus the spec should recommend that UAs which implement the Push API either:
a) do not implement the Notifications API at all; or
b) implement and ship Notifications Service Worker API before or together with shipping the Push API.

@beverloo
Copy link
Member

beverloo commented Mar 2, 2015

The Push API does not have a dependency on the Notification API. I don't think this makes sense unless we decide to add such a dependency, e.g. implement an option bag for subscribe()/hasPermission(), which is a larger issue.

On a tangent, ServiceWorkerRegistration.prototype.hasOwnProperty('showNotification') works on both documents and workers.

@johnmellor
Copy link
Contributor Author

Good point - if developers check that ServiceWorkerRegistration.prototype contains showNotification this won't be an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants