Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- document.addEventListener('DOMContentLoaded', initPage, false);
- function initPage() {
- if (!('Notification' in window)) {
- // this browser does not support notifications
- } else if (Notification.permission === 'denied') {
- // the user denied notification permission!
- else if (Notification.permission === 'granted') {
- pirateManager.subscribeToPush();
- } ...
- function enableNotifications() {
- Notification.requestPermission().then((result) => {
- pirateManager.subscribeToPush();
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement