Reputation: 2528
Assume we have a website www.example.com
and we are running 2 different service worker under different scopes.
www.example.com/pwa1
(scope /pwa1
)www.example.com/pwa2
(scope /pwa2
)Now we want to allow users to install these PWA as an app in their launcher. And browser trigger beforeinstallprompt
event to handle this, based on a few criteria. Also, if the user declines the installation, it might not trigger this event for the next 3 months.
So my questions are:
beforeinstallprompt
event triggered separately for pwa1
and pwa2
or is it considered for an origin?pwa1
, does this have any impact in pwa2
?Upvotes: 0
Views: 635
Reputation: 1945
beforeinstallprompt
event will be triggered separately. A PWA is based on the manifest and the scope defined in it.Also, if the user declines the installation, it might not trigger this event for the next 3 months.
This is only the case for the mini-infobar shown on Chrome for Android. The beforeinstallprompt
event will always be triggered if the site meets the install criteria, allowing you to add your own install promotion.
Upvotes: 1