1

We know that the beforeinstallprompt event is fired when the PWA meets the installability criteria. Two of them are: - The user needs to have clicked or tapped on the page at least once (at any time, even during a previous page load) - The user needs to have spent at least 30 seconds viewing the page (at any time) How can I reset the browser "memory" to test my PWA in a clean environment? If I open my PWA on my browser, I have already passed these two criteria so my PWA always prompts for the install banner. But I need to emulate a new user for which the beforeinstallprompt is not triggered immediately. I've tried in incognito mode, but Chrome doesn't quite fire the beforeinstallprompt event in this mode. How can I do? Many thanks in advance

Tried: incognito mode, deletion of cookies.

Cris
  • 11
  • 1

1 Answers1

0

In Google Chrome, the only way I could find to do this was to create a separate Chrome user profile.

https://support.google.com/chrome/answer/2364824

I created a new user profile named "test 1." In the new profile, onbeforeinstallprompt didn't fire until I clicked and waited 30 seconds. Then, I deleted the "test 1" profile and created a new one, "test 2." And, again, in the new profile, onbeforeinstallprompt needed a click and 30 seconds of waiting to fire.

I was then able to delete the "test 2" profile and re-create a profile named "test 1," and again had to wait 30 seconds for onbeforeinstallprompt. Thus, by deleting and recreating the "test 1" and "test 2" profiles, I could test and retest onbeforeinstallprompt over and over again.

Dan Fabulich
  • 37,506
  • 41
  • 139
  • 175