initPage.js

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(); }); }
Add a call to pirateManager.subscribeToPush in the peggy_parrot script on the check to see if notifications have been enabled

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.