StorageManager

Secure context
This feature is available only in secure contexts (HTTPS), in some or all supporting browsers .

这是 实验性技术
检查 浏览器兼容性表格 在生产中使用这之前。

StorageManager interface of the the Storage API provides an interface for managing persistance permissions and estimating available storage. You can get a reference to this interface using either navigator.storage or WorkerNavigator.storage .

方法

StorageManager.estimate() Secure context
返回 Promise that resolves to a StorageEstimate object containing usage and quota numbers for your origin.
StorageManager.persist() Secure context
返回 Promise that resolves to true if the user agent is able to persist your site's storage.
StorageManager.persisted() Secure context
返回 Promise that resolves to true if persistence has already been granted for your site's storage.

规范

规范 状态 Comment
Storage
The definition of 'StorageManger' in that specification.
实时标准 初始定义。

浏览器兼容性

更新 GitHub 上的兼容性数据
Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
StorageManager Chrome 48 Edge ≤79 Firefox 57
57
不支持 51 — 57
Disabled
bug 1304966 and bug 1399038 .
Disabled From version 51 until version 57 (exclusive): this feature is behind the dom.storageManager.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
IE ? Opera Yes Safari ? WebView Android 48 Chrome Android 48 Firefox Android 51
Disabled
51
Disabled
bug 1304966 and bug 1399038 .
Disabled From version 51: this feature is behind the dom.storageManager.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
Opera Android Yes Safari iOS ? Samsung Internet Android 5.0
estimate Chrome 52 Edge ≤79 Firefox 51 IE ? Opera Yes Safari ? WebView Android 52 Chrome Android 52 Firefox Android 51 Opera Android Yes Safari iOS ? Samsung Internet Android 6.0
persist Chrome 52
52
不支持 48 — 52
Alternate Name
Alternate Name Uses the non-standard name: requestPersistent
Edge ≤79 Firefox 55 IE ? Opera Yes Safari ? WebView Android 52
52
不支持 48 — 52
Alternate Name
Alternate Name Uses the non-standard name: requestPersistent
Chrome Android 52
52
不支持 48 — 52
Alternate Name
Alternate Name Uses the non-standard name: requestPersistent
Firefox Android 55 Opera Android Yes Safari iOS ? Samsung Internet Android 6.0
6.0
不支持 5.0 — 6.0
Alternate Name
Alternate Name Uses the non-standard name: requestPersistent
persisted Chrome 52
52
不支持 48 — 52
Alternate Name
Alternate Name Uses the non-standard name: persistentPermission
Edge ≤79 Firefox 55 IE ? Opera Yes Safari ? WebView Android 52
52
不支持 48 — 52
Alternate Name
Alternate Name Uses the non-standard name: persistentPermission
Chrome Android 52
52
不支持 48 — 52
Alternate Name
Alternate Name Uses the non-standard name: persistentPermission
Firefox Android 55 Opera Android Yes Safari iOS ? Samsung Internet Android 6.0
6.0
不支持 5.0 — 6.0
Alternate Name
Alternate Name Uses the non-standard name: persistentPermission

图例

完整支持
完整支持
兼容性未知
兼容性未知
见实现注意事项。
用户必须明确启用此特征。
用户必须明确启用此特征。
使用非标名称。