StorageManager
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since December 2021.
Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.
Note: This feature is available in Web Workers.
Giao diện StorageManager của Storage API cung cấp một giao diện để quản lý quyền lưu trữ bền vững và ước lượng dung lượng lưu trữ khả dụng. Bạn có thể lấy tham chiếu đến giao diện này bằng navigator.storage hoặc WorkerNavigator.storage.
Phương thức thể hiện
StorageManager.estimate()-
Trả về một
Promiseđược giải quyết bằng một đối tượng chứa các số liệuusagevàquotacho origin của bạn. StorageManager.getDirectory()-
Dùng để lấy tham chiếu đến một đối tượng
FileSystemDirectoryHandlecho phép truy cập một thư mục và nội dung của nó, được lưu trong origin private file system. Trả về mộtPromiseđược thực thi thành công với một đối tượngFileSystemDirectoryHandle. StorageManager.persist()-
Trả về một
Promiseđược giải quyết thànhtruenếu user agent có thể lưu trữ bền vững dữ liệu của trang web bạn. StorageManager.persisted()-
Trả về một
Promiseđược giải quyết thànhtruenếu quyền lưu trữ bền vững đã được cấp cho dữ liệu của trang web bạn.
Thông số kỹ thuật
| Specification |
|---|
| Storage> # storagemanager> |