Advertisement
Guest User

Untitled

a guest
Jun 27th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. document.addEventListener('DOMContentLoaded', initPage, false);
  2. function initPage() {
  3. if (!('Notification' in window)) {
  4. // this browser does not support notifications
  5. } else if (Notification.permission === 'denied') {
  6. // the user denied notification permission!
  7. else if (Notification.permission === 'granted') {
  8. pirateManager.subscribeToPush();
  9. } ...
  10. function enableNotifications() {
  11. Notification.requestPermission().then((result) => {
  12. pirateManager.subscribeToPush();
  13. });
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement