We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTML Downlaod
Javascript
<script type="text/javascript"> var pwaInstallBtn = document.getElementById('pwa-install'); let isInitiatePwa = false; pwaInstallBtn.style.display = 'none'; window.addEventListener('beforeinstallprompt', (e) => { // Prevent the mini-infobar from appearing on mobile e.preventDefault(); window.deferredPrompt = e; pwaInstallBtn.style.display = 'block'; }); pwaInstallBtn.addEventListener('click', (e) => { // Show the install prompt const deferredPrompt = window.deferredPrompt; deferredPrompt.prompt(); // Wait for the user to respond to the prompt deferredPrompt.userChoice.then((choiceResult) => { if (choiceResult.outcome === 'accepted') { console.log('User accepted the install prompt'); } else { console.log('User dismissed the install prompt'); } }); }); window.addEventListener('appinstalled', (evt) => { pwaInstallBtn.style.display = 'none' window.deferredPrompt = null // Log install to analytics // console.log('INSTALL: Success'); }); </script>
The text was updated successfully, but these errors were encountered:
No branches or pull requests
HTML
Downlaod
Javascript
The text was updated successfully, but these errors were encountered: