Last active
July 31, 2023 00:37
-
-
Save deanhume/6fe490f127c5024780d1a3e4efb8dcea to your computer and use it in GitHub Desktop.
Persistent Storage API - Progressive Web Apps
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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