[英]how to test beforeinstallprompt event on desktop to check it's working
I have integrated PWA features in react web app and beforeinstallprompt event gets triggered in production app when opened in mobile.我在 react web 应用程序中集成了 PWA 功能,并且在移动设备中打开生产应用程序时会触发 beforeinstallprompt 事件。 I want to trigger this event on desktop development environment.我想在桌面开发环境中触发这个事件。 Is there a way to achieve that.有没有办法做到这一点。 I referred stackoverflow answer regarding this problem and updated chrome browser settings but the event is not triggered.我参考了有关此问题的stackoverflow 答案并更新了 chrome 浏览器设置,但未触发该事件。
It depends on the browser.这取决于浏览器。 beforeinstallprompt is triggered on chrome 102 and edge 102 for me but not on firefox 101. it is not triggered if the app is already installed. beforeinstallprompt 对我来说是在 chrome 102 和 edge 102 上触发的,但不是在 firefox 101 上触发的。如果已经安装了应用程序,则不会触发它。
Check here for a list of supported browsers: https://developer.mozilla.org/en-US/docs/Web/API/BeforeInstallPromptEvent在此处查看支持的浏览器列表: https://developer.mozilla.org/en-US/docs/Web/API/BeforeInstallPromptEvent
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.