Skip to Content
Platform.Ontology

Storage feature detection (localStorage, sessionStorage, IndexedDB, openDatabase, addBehavior)

Tests which storage APIs work in this browser.

Gets silentlyFiles and storageStorageWeb browsersWhen the page loadsWhile you use it

In one line

Can test which storage tools your browser lets it use

Tests which storage APIs work in this browser.

Support patterns show browser type and settings such as blocked storage. Old APIs (openDatabase, addBehavior) separate engines.

What it can and can't do

What the user does: Nothing. It happens when the page loads.

It can

  • Check whether localStorage, sessionStorage and IndexedDB work
  • Tell old browsers from new ones
  • Guess private mode from the results
  • Add the results to a browser fingerprint

It cannot

  • See what is stored by other sites
  • See what you saved
  • Change or delete anything

Browser support

BrowserStatusFirst versionReleasedNote
ChromeSupported42010-01-25None
EdgeSupported122015-07-29None
FirefoxSupported3.52009-06-30None
SafariSupported42009-06-08None
Safari on iPhoneSupported3.22010-04-03None
Chrome on AndroidSupported182012-06-27None
Samsung InternetSupported1.02013-04-27None

How a site asks for it

APIwindow.localStorage, sessionStorage, indexedDB, openDatabase, document.body.addBehavior
Browser compat keysapi.Window.localStorage
How access is grantednone
What the user seesNone (no browser prompt)
Needs a secure context (HTTPS)No
Needs a user gestureNo
How long it lastsNot listed
How to take it backNot listed
Inside an iframeNot listed

Typical flow

  1. Script reads the value
  2. Value joins the fingerprint payload

Data you get

What comes back: Storage feature detection (localStorage, sessionStorage, IndexedDB, openDatabase, addBehavior)
Shape: object
How often: static

FieldTypeUnitRangePrecision
localStoragebooleanNoneNot listedNot listed
sessionStoragebooleanNoneNot listedNot listed
indexedDbbooleanNoneNot listedNot listed
openDatabasebooleanNoneNot listedNot listed
addBehaviorbooleanNoneNot listedNot listed

Technical limits

  • Only presence, not stored data

The story

What it is

A page tests which storage tools your browser supports, such as localStorage, IndexedDB and old add-ons.

For you

You never see it. The page tries each storage type, then picks one that works. It also learns a bit about your browser and any privacy settings.

For makers

Makers use it so sites do not break when a browser blocks storage. The pattern of what works also helps tell browsers and privacy modes apart, which fingerprinting scripts like.

Where you see it

TypeExampleApps
gamesA browser game tests if it can save progress, and warns you if private mode blocks it.None named
shoppingA store tests cookies and storage before it builds your cart, and shows a warning if they are off.None named
securityA fraud service notes that a browser says it supports old Internet Explorer storage tricks, which is a sign of a faked identity.None named
adsA fingerprint script builds a profile from which storage tools work and which fail.None named
analyticsA site checks if storage works so it can choose between cookies and a fallback for counting visits.Google Analytics
productivityA web app falls back to a server copy if local storage is off.None named

Risks

  • Fingerprint clue
  • Reveals privacy settings

Good uses and abuse

Legitimate uses

  • Fallbacks

Known abuse

  • Fingerprint input

Scores

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

A real example: LinkedIn

Collector key(s): sessionStorage, localStorage, indexedDb, addBehavior, openDatabase.

Sources

How well checked: Based on official documentation.

On this page