📜  pwa install - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:50:05.700000             🧑  作者: Mango

代码示例1
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();});