cubiq / add-to-homescreen

Add to home screen call-out for mobile devices
http://cubiq.org/add-to-home-screen
2.29k stars 747 forks source link

Callout appears after Safari is suspended. #250

Open Giardinor2i opened 7 years ago

Giardinor2i commented 7 years ago

The "Add to Home Screen" will appear even if you have already closed it (as well as having a long displayPace) if you double-tap the home button and swipe-to-close-safari followed by reloading it.

In other words:

  1. Open page with addToHomeScreen();
  2. Decline adding to home screen.
  3. Double tap home and close safari.
  4. Reopen safari
  5. Safari will open with the same page you left on, but the addToHomescreen callout will appear again.

This does not happen if you simply refresh the page or navigate back to the page from somewhere else. I believe this is related to the way iOS and Safari store web pages when the app is suspended. I just haven't been able to pinpoint where this is happening or how to prevent it myself.