Files
servo/components/script_bindings/webidls/StorageManager.webidl
Taym Haddadi 5ac8bf4db3 Implement StorageManager API (#43976)
Add the Storage Standard WebIDL for NavigatorStorage and StorageManager,
wire navigator.storage on Window and Worker, and implement persisted(),
persist(), and estimate().


Testing: covered by WP test.
part of #39100

fixes #39101

---------

Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
2026-04-21 13:41:58 +00:00

30 lines
802 B
Plaintext

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://storage.spec.whatwg.org/#api
[SecureContext]
interface mixin NavigatorStorage {
[SameObject, Pref="dom_storage_manager_api_enabled"] readonly attribute StorageManager storage;
};
Navigator includes NavigatorStorage;
WorkerNavigator includes NavigatorStorage;
[SecureContext, Exposed=(Window,Worker)]
interface StorageManager {
[NewObject]
Promise<boolean> persisted();
[Exposed=Window, NewObject]
Promise<boolean> persist();
[NewObject]
Promise<StorageEstimate> estimate();
};
dictionary StorageEstimate {
unsigned long long usage;
unsigned long long quota;
};