<script> window.addEventListener("beforeinstallprompt", function(event) { let a = event.prompt() a.userChoice.then(aa=>{ if(aa.outcome == "accepted") { alert("") } }) }) </script>