Skip to content

Instantly share code, notes, and snippets.

@deanhume
Last active July 31, 2023 00:37
Show Gist options
  • Save deanhume/6fe490f127c5024780d1a3e4efb8dcea to your computer and use it in GitHub Desktop.
Save deanhume/6fe490f127c5024780d1a3e4efb8dcea to your computer and use it in GitHub Desktop.
Persistent Storage API - Progressive Web Apps
if (navigator.storage && navigator.storage.persist) {
navigator.storage.persist().then(granted => {
if (granted) {
alert("Storage will persist and not be cleared");
} else {
alert("Storage won’t persist and may be cleared");
}
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment