Skip to content

StorageManager.estimate #221

Closed
Closed

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

Activity

  1. moved this to Proposed in Interop 2023on Oct 16, 2022
  2. foolip commented on Oct 17, 2022

    @foolip
    Member

    I see one of the tests is tentative. Does anyone know why that is?

  3. mkruisselbrink commented on Oct 24, 2022

    @mkruisselbrink

    I see one of the tests is tentative. Does anyone know why that is?

    Probably because the spec for usageDetails currently only lives in a PR (whatwg/storage#69), because of lack of cross-browser interest.

  4. foolip commented on Nov 11, 2022

    @foolip
    Member

    In the MDN short survey on APIs & JavaScript, "Storage quota estimation (navigator.storage.estimate())" was selected by ~8% of survey takers, putting it in the bottom third of options. (There is some uncertainty as with any survey data.)

  5. nt1m commented on Jan 7, 2023

    @nt1m
    Member

    WebKit just implemented StorageManager.estimate in WebKit/WebKit@a793d8b

  6. nairnandu commented on Feb 1, 2023

    @nairnandu
    Contributor

    Thank you for proposing the StorageManager.estimate for inclusion in Interop 2023.

    We wanted to let you know that this proposal was not selected to be part of Interop this year. We had many strong proposals, and could not accept them all. This should not be taken as a comment on the technology as a whole.

    For an overview of our process, see the proposal selection summary. Thank you again for contributing to Interop 2023!

    Posted on behalf of the Interop team.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    focus-area-proposal

    Type

    No type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions