Javascript 更改标准pwa安装通知

Javascript 更改标准pwa安装通知,javascript,css,web,progressive-web-apps,Javascript,Css,Web,Progressive Web Apps,是否可以更改pwa的“添加到主屏幕”通知的样式 或者您可以关闭它并使用通知组件吗? pwa I的设置使用标准 您可以捕获beforeinstallprompt事件,并使用它显示自定义安装提示 let deferredPrompt; window.addEventListener('beforeinstallprompt', (e) => { // Prevent the mini-infobar from appearing on mobile e.preventDefault(

是否可以更改pwa的“添加到主屏幕”通知的样式

或者您可以关闭它并使用通知组件吗? pwa I的设置使用标准


您可以捕获
beforeinstallprompt
事件,并使用它显示自定义安装提示

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();
});

您可以捕获安装前提示事件
并使用它显示自定义安装提示

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();
});