Comments (3)
See discussion on public-webapps and w3c/ServiceWorker/issues/365.
Jake's suggestion (copied below) seems a very clean way of doing this, resolving the earlier concerns:
navigator.serviceWorker.ready.then(function(reg) {
reg.push.register(...);
});
See also similar background sync issue: WICG/background-sync/issues/6
from push-api.
Just updating John's code sample to the latest syntax:
navigator.serviceWorker.ready.then(function(serviceWorkerRegistration) {
serviceWorkerRegistration.pushRegistrationManager.register().then(...);
});
from push-api.
Closed by #13
from push-api.
Related Issues (20)
- Does PushManager subscribe() need transient activation check? HOT 2
- Question: what about shared device
- TPAC 2022 status report
- Documentation: It's not clear how to specify the push service HOT 2
- Browser MUST always display a permission prompt after a user interaction HOT 2
- New push subscription MUST have an endpoint that's different from the original HOT 1
- Best practices to dismiss web push notifications cross devices HOT 1
- Declarative Web Push HOT 14
- Permission Revocation - English language clarification
- Mention Safari Implementation HOT 1
- WPT testability HOT 1
- Provide support email for the major web push services HOT 5
- PushSubscription and underlying concept should be better separated
- oldSubscription is never null
- Security and privacy considerations should not contain requirements
- PushSubscription IDL links broken
- unsubscribe() method interaction with event loop HOT 1
- PushMessageData is poorly defined and seems broken HOT 1
- json() should be defined in terms of Infra
- What is a push subscription associated with? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from push-api.