Persistent storage (persist)
Asks the browser not to delete this site's stored data under disk pressure.
In one line
Can ask the browser not to delete its saved data when disk space is low
Asks the browser not to delete this site's stored data under disk pressure.
Protects offline data (notes, drafts, downloaded media) from automatic eviction. Chrome and Safari decide silently from engagement; Firefox asks the person. A grant does not raise the quota.
What it can and can't do
What the user does: In Firefox you click Allow on Store data in persistent storage. Elsewhere nothing: the browser decides.
It can
- Ask the browser to protect its saved data from automatic cleanup
- Check whether the request was granted
- Check roughly how much space it has used
It cannot
- Make the browser agree, since Chrome and Safari decide on their own
- Stop you clearing site data yourself
- Keep data after a private window closes
How it differs between platforms: Firefox asks you. Chrome and Safari give it quietly, based on signs like installing the site, a bookmark or heavy use.
Browser support
| Browser | Status | First version | Released | Note |
|---|---|---|---|---|
| Chrome | Supported | 55 | 2016-12-01 | None |
| Edge | Supported | 79 | 2020-01-15 | None |
| Firefox | Supported | 57 | 2017-11-14 | None |
| Safari | Supported | 15.2 | 2021-12-13 | Safari 15.2 on macOS, 17 on iOS |
| Safari on iPhone | Supported | 15.2 | 2021-12-13 | None |
| Chrome on Android | Supported | 55 | 2016-12-06 | None |
| Samsung Internet | Supported | 6.0 | 2017-08-23 | None |
How a site asks for it
| API | navigator.storage.persist(), persisted(), estimate() |
| Permission name | persistent-storage |
| Browser compat keys | api.StorageManager.persistapi.StorageManager.persisted |
| How access is granted | prompt |
| What the user sees | Firefox: bubble Store data in persistent storage, Allow or Don't allow. Chrome and Safari: no prompt, granted by heuristics (installed, bookmarked, notifications on, high engagement). |
| Needs a secure context (HTTPS) | Yes |
| Needs a user gesture | No |
| How long it lasts | Persistent until cleared by the person |
| How to take it back | Site settings, clearing site data |
| Inside an iframe | Not delegated to iframes |
Typical flow
- Call navigator.storage.persist()
- Browser prompts (Firefox) or checks heuristics
- Promise resolves true or false
- Data is exempt from best-effort eviction
Data you get
What comes back: Whether storage is persistent
Shape: boolean
How often: one-shot
| Field | Type | Unit | Range | Precision |
|---|---|---|---|---|
persisted | boolean | none | true or false | 1 bit |
usage | integer | bytes | 0 to quota | padded for cross-origin data |
quota | integer | bytes | see quota entry | rounded |
Technical limits
- Never beyond the quota
- Chrome and Safari give no prompt: the answer is automatic
- Safari still clears script-written data after 7 days without interaction unless installed
The story
What it is
Asks the browser not to delete this site's stored data when your disk runs low.
For you
In some browsers a small prompt asks 'Allow this site to store data in your browser?' In Chrome the decision is automatic, based on use and bookmarks. You usually just see nothing.
For makers
It protects work that is only on the device, like drafts, saves and offline files. Makers ask when losing data would hurt trust. The browser may decline.
Where you see it
| Type | Example | Apps |
|---|---|---|
| games | A browser game asks to protect your save file so you do not lose hours of play. | None named |
| productivity | A note taking app asks to keep your offline notes before they sync. | None named |
| creative | A web design or music tool asks to keep a long local project. | None named |
| media | A web music or reading app asks to keep your downloaded content. | None named |
| enterprise | A field work app asks to protect forms filled out without a signal. | None named |
| health | A health diary web app asks to keep entries safe on your device. | None named |
Risks
- May use more space
- Decision is mostly automatic
What the platform says
- web.dev: Persistent storage. Google explains how a web app can ask to keep its data safe from cleanup.
- MDN: StorageManager persist. Documents the call a site makes to ask for protected storage.
Good uses and abuse
Legitimate uses
- Offline notes
- Cached media
Known abuse
- Fingerprint via estimate rounding
Scores
| Score | Value | Meaning |
|---|---|---|
| Sensitivity | 2 of 5 | How revealing the data is |
| Utility | 4 of 5 | How useful it is to honest apps |
| Friction | 2 of 5 | How much the user has to do |
| Fingerprint bits | 1 | Rough identifying entropy, when known |
History
- 2016-12, Chrome 55: persist() ships
- 2017-11, Firefox 57: persist() ships with a prompt
Related capabilities
Related
- Storage quotas and eviction. Can store only what your browser allows, and may lose it when space is low
Sources
How well checked: Based on official documentation.