Skip to content

StorageManager.estimate #221

@svoisen

Description

@svoisen

Description

The StorageManager interface of the Storage API provides an interface for managing persistence permissions and estimating available storage. StorageManager.estimate returns a Promise that resolves to an object containing usage and quota numbers for an origin.

Not all browsers support the estimate method on StorageManager. And where it is supported, implementations are inconsistent. For instance:

  • WebKit does not support estimate at all.
  • Gecko supports estimate but not details such as usageDetails.

Rationale

For applications that make heavy use of local storage, this API becomes increasingly critical in order to understand when an application is about to hit storage limits and warn users or take preventative measures. This becomes even more important as more applications use newer quota-limited storage APIs such as OPFS (+ AccessHandles) which will soon be supported in all browsers.

Specification

https://storage.spec.whatwg.org/#ref-for-dom-storagemanager-estimate

Tests

https://wpt.fyi/results/storage/storagemanager-estimate.https.any.html?label=experimental&label=master&aligned
https://wpt.fyi/results/storage/estimate-usage-details-caches.https.tentative.any.worker.html

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions