📅  最后修改于: 2022-03-11 14:50:05.700000             🧑  作者: Mango
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();});