[ Mini Kiebo ]
Server: Windows NT DESKTOP-5B8S0D4 6.2 build 9200 (Windows 8 Professional Edition) i586
Path:
D:
/
Backup
/
14082024
/
Data
/
htdocs
/
htdocs
/
siakad
/
mobile
/
[
Home
]
File: index.js
// Register Service worker to control making site work offline if ('serviceWorker' in navigator) { navigator.serviceWorker .register('app.js') .then(() => { console.log('Service Worker Registered'); }); } // Code to handle install prompt on desktop let deferredPrompt; const pwaBtn = document.querySelector('.pwa-btn'); //pwaBtn.style.display = 'none'; window.addEventListener('beforeinstallprompt', (e) => { // Prevent Chrome 67 and earlier from automatically showing the prompt e.preventDefault(); // Stash the event so it can be triggered later. deferredPrompt = e; // Update UI to notify the user they can add to home screen //pwaBtn.style.display = 'block'; pwaBtn.addEventListener('click', () => { // hide our user interface that shows our A2HS button //pwaBtn.style.display = 'none'; // Show the prompt deferredPrompt.prompt(); // Wait for the user to respond to the prompt deferredPrompt.userChoice.then((choiceResult) => { if (choiceResult.outcome === 'accepted') { console.log('User accepted the A2HS prompt'); } else { console.log('User dismissed the A2HS prompt'); } deferredPrompt = null; }); }); });