1 2// console.log(navigator) 3if ('serviceWorker' in navigator) { 4 navigator.serviceWorker 5 .register('/firebase-messaging-sw.js') 6 .then((swReg) => { 7 // console.log('Service Worker Registered'); 8 swReg.pushManager.getSubscription().then((sub) => { 9 // console.log('Subscription Info', sub) 10 }) 11 }); 12} 13 14// Code to handle install prompt on desktop 15 16window.deferredPrompt = null 17 18window.addEventListener('beforeinstallprompt', (e) => { 19 // console.log(e, "e") 20 // Prevent Chrome 67 and earlier from automatically showing the prompt 21 e.preventDefault(); 22 // Stash the event so it can be triggered later. 23 window.deferredPrompt = e; 24 // Update UI to notify the user they can add to home screen 25 26 // addBtn.addEventListener('click', () => { 27 // // hide our user interface that shows our A2HS button 28 // addBtn.style.display = 'none'; 29 // // Show the prompt 30 // deferredPrompt.prompt(); 31 // // Wait for the user to respond to the prompt 32 // deferredPrompt.userChoice.then((choiceResult) => { 33 // if (choiceResult.outcome === 'accepted') { 34 // console.log('User accepted the A2HS prompt'); 35 // } else { 36 // console.log('User dismissed the A2HS prompt'); 37 // } 38 // deferredPrompt = null; 39 // }); 40 // }); 41}); 42window.deferredPromptPrompt = function() { 43 window.deferredPrompt.prompt(); 44 window.deferredPrompt.userChoice.then((choiceResult) => { 45 if (choiceResult.outcome === 'accepted') { 46 // console.log('User accepted the A2HS prompt'); 47 48 localStorage.setItem('kayaPwaCloseNum', '10001') 49 } else { 50 // console.log('User dismissed the A2HS prompt'); 51 } 52 deferredPrompt = null; 53 }); 54}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.