Skip to Content
Platform.Ontology

Persistent storage (persist)

Asks the browser not to delete this site's stored data under disk pressure.

Asks you firstFiles and storageStorageWeb browsersWhile you use it

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

BrowserStatusFirst versionReleasedNote
ChromeSupported552016-12-01None
EdgeSupported792020-01-15None
FirefoxSupported572017-11-14None
SafariSupported15.22021-12-13Safari 15.2 on macOS, 17 on iOS
Safari on iPhoneSupported15.22021-12-13None
Chrome on AndroidSupported552016-12-06None
Samsung InternetSupported6.02017-08-23None

How a site asks for it

APInavigator.storage.persist(), persisted(), estimate()
Permission namepersistent-storage
Browser compat keysapi.StorageManager.persist
api.StorageManager.persisted
How access is grantedprompt
What the user seesFirefox: 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 gestureNo
How long it lastsPersistent until cleared by the person
How to take it backSite settings, clearing site data
Inside an iframeNot delegated to iframes

Typical flow

  1. Call navigator.storage.persist()
  2. Browser prompts (Firefox) or checks heuristics
  3. Promise resolves true or false
  4. Data is exempt from best-effort eviction

Data you get

What comes back: Whether storage is persistent
Shape: boolean
How often: one-shot

FieldTypeUnitRangePrecision
persistedbooleannonetrue or false1 bit
usageintegerbytes0 to quotapadded for cross-origin data
quotaintegerbytessee quota entryrounded

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

TypeExampleApps
gamesA browser game asks to protect your save file so you do not lose hours of play.None named
productivityA note taking app asks to keep your offline notes before they sync.None named
creativeA web design or music tool asks to keep a long local project.None named
mediaA web music or reading app asks to keep your downloaded content.None named
enterpriseA field work app asks to protect forms filled out without a signal.None named
healthA 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

Good uses and abuse

Legitimate uses

  • Offline notes
  • Cached media

Known abuse

  • Fingerprint via estimate rounding

Scores

ScoreValueMeaning
Sensitivity2 of 5How revealing the data is
Utility4 of 5How useful it is to honest apps
Friction2 of 5How much the user has to do
Fingerprint bits1Rough identifying entropy, when known

History

  • 2016-12, Chrome 55: persist() ships
  • 2017-11, Firefox 57: persist() ships with a prompt

Sources

How well checked: Based on official documentation.

On this page