blob: afc0bd77ad6654e34bf4293fd66623fe7fc403ac (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
---
title: StorageManager
slug: Web/API/StorageManager
tags:
- API
- Interface
- NeedsTranslation
- Persistence
- Quotas
- Reference
- Secure context
- Storage
- Storage API
- StorageManager
- TopicStub
- Usage
translation_of: Web/API/StorageManager
---
<p>{{securecontext_header}}{{SeeCompatTable}}{{APIRef("Storage")}}</p>
<p>The <strong><code>StorageManager</code></strong> interface of the the <a href="/en-US/docs/Web/API/Storage_API">Storage API</a> provides an interface for managing persistance permissions and estimating available storage. You can get a reference to this interface using either {{domxref("navigator.storage")}} or {{domxref("WorkerNavigator.storage")}}.</p>
<h2 id="Methods">Methods</h2>
<dl>
<dt>{{domxref("StorageManager.estimate()")}} {{securecontext_inline}}</dt>
<dd>Returns a {{domxref("StorageEstimate")}} object containing usage and quota numbers for your origin.</dd>
<dt>{{domxref("StorageManager.persist()")}} {{securecontext_inline}}</dt>
<dd>Returns a {{jsxref('Promise')}} that resolves to <code>true</code> if the user agent is able to persist your site's storage.</dd>
<dt>{{domxref("StorageManager.persisted()")}} {{securecontext_inline}}</dt>
<dd>Returns a {{jsxref('Promise')}} that resolves to <code>true</code> if persistence has already been granted for your site's storage.</dd>
</dl>
<h2 id="Specifications">Specifications</h2>
<table class="standard-table">
<tbody>
<tr>
<th scope="col">Specification</th>
<th scope="col">Status</th>
<th scope="col">Comment</th>
</tr>
<tr>
<td>{{SpecName('Storage','#storagemanager','StorageManger')}}</td>
<td>{{Spec2('Storage')}}</td>
<td>Initial definition.</td>
</tr>
</tbody>
</table>
<h2 id="Browser_compatibility">Browser compatibility</h2>
<p>{{Compat("api.StorageManager")}}</p>
|