What is the beforeinstallprompt event?
The beforeinstallprompt event is fired by the browser right before it shows the default "Add to Home Screen" mini-infobar. By intercepting this event and calling preventDefault(), you cancel the default browser behavior and save the event object. You can then use this saved object to trigger the install prompt at a better time (e.g., when a user clicks a custom "Install App" button in your UI).