我正在尝试在我的渐进式网络应用程序上创建一个“添加到主屏幕”按钮,如Chrome'sdocumentation中所述.我通常遵循规定的模式,我有一些隐藏按钮,当Chrome的beforeinstallprompt事件触发时显示。一旦事件触发,我就捕获该事件,然后在单击我自己的安装按钮后使用该事件开始native安装对话。示例代码如下:letdeferredPrompt;window.addEventListener('beforeinstallprompt',(e)=>{//PreventChrome67andearlierfromautomaticallyshowingtheprom