简体   繁体   English

如何在桌面上测试 beforeinstallprompt 事件以检查它是否正常工作

[英]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.

相关问题 PWA 应用程序 beforeInstallPrompt 未在移动浏览器中触发但可在普通桌面浏览器中运行 - PWA app beforeInstallPrompt not firing in mobile browser but working in normal desktop browser PWA:preventDefault 不适用于 beforeinstallprompt - PWA: preventDefault not working with beforeinstallprompt PWA:如何在安装提示之前重新触发? - PWA: How to retrigger beforeinstallprompt? 即使在安装应用程序之后,`beforeinstallprompt` 事件也会触发 - `beforeinstallprompt` event is firing even after the app is installed beforeinstallprompt 事件为源或服务工作者触发 scope - beforeinstallprompt event is triggered for a origin or for a service worker scope 未为在 SPA 上创建的 PWA 调用“beforeinstallprompt”事件 - 'beforeinstallprompt' event not called for the PWA created on a SPA beforeinstallprompt 不会在 PWA 的 Vue 应用程序中触发 - beforeinstallprompt not trigger within a PWA's Vue app 触发 Beforeinstallprompt 事件后添加到主屏幕不提示 - Add to Home Screen not prompt after Beforeinstallprompt event fired 我如何在应用内浏览器中使用“beforeinstallprompt” - How can i use “beforeinstallprompt” for in-app browser PWA 在第一次安装提示前触发,但从桌面删除应用程序后,不再触发 - PWA fires beforeinstallprompt first time, but after deleting app from desktop, never fires again
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM