jeudi 4 janvier 2018

Save state in a webapp before a user navigates away

In the past, listening for onbeforeunload could enable a developer to alert the user that there is unsaved data, and they might not want to navigate away from the current page in the browser.

Now Chrome doesn't support onbeforeunload and recommends the Page Visibility API. Understanding whether a page is being viewed or not seems useful for some things, but how does a web application tell a user who is navigating away that some of their data hasn't yet been synced?




Aucun commentaire:

Enregistrer un commentaire