Skip to content

Commit

Permalink
test:sw
Browse files Browse the repository at this point in the history
  • Loading branch information
freeshineit committed Jun 1, 2024
1 parent 239ed8a commit bcf6a49
Showing 1 changed file with 1 addition and 23 deletions.
24 changes: 1 addition & 23 deletions public/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,35 +49,13 @@ <h3 onclick="showNotification()">点击</h3>

setInterval(() => {
showNotification()
}, 5000)
}, 10000)
})

} else {
console.log('不支持SW:')
}

// Initialize deferredPrompt for use later to show browser install prompt.
// let deferredPrompt;

// window.addEventListener('beforeinstallprompt', (e) => {
// // Prevent the mini-infobar from appearing on mobile
// e.preventDefault();
// // Stash the event so it can be triggered later.
// deferredPrompt = e;
// // Update UI notify the user they can install the PWA
// showInstallPromotion();
// // Optionally, send analytics event that PWA install promo was shown.
// console.log(`'beforeinstallprompt' event was fired.`);
// });

// window.addEventListener('appinstalled', () => {
// // Hide the app-provided install promotion
// hideInstallPromotion();
// // Clear the deferredPrompt so it can be garbage collected
// deferredPrompt = null;
// // Optionally, send analytics event to indicate successful install
// console.log('PWA was installed');
// });
</script>

</html>

0 comments on commit bcf6a49

Please sign in to comment.