Reputation: 4122
I'm using the navigator.storage.persist()
API on Chrome, and have managed to get it set to true
. But I would like to (at least for testing) be able to clear the setting putting back to false
.
The API definition does not include a method or flag to clear as far as I can tell. See https://developer.mozilla.org/en-US/docs/Web/API/StorageManager and the living standard: https://storage.spec.whatwg.org/#storagemanager
However, for my purposes it would also be acceptable if there was a way from 'Site settings', the clear cache options, or even a custom page like the chrome://appcache-internals/ page for appcache.
If not, where does the flag get stored? i.e. what would I need to delete in the file system to reset things?
Upvotes: 4
Views: 942
Reputation: 14539
I has not been able to find a way to clear the flag for a specific website.
But for testing purposes (as you requested), the flag returned by the StorageManager.persisted()
can be cleared by:
chrome://settings/?search=cooki
Clear browsing data
Cookies and other site data
in the popup and click Clear
data
buttonAfter performing the above steps, StorageManager.persisted()
starts to return false
.
Upvotes: 2