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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
|
---
title: StorageEstimate
slug: Web/API/StorageEstimate
translation_of: Web/API/StorageEstimate
---
<div>{{securecontext_header}}{{APIRef("Storage")}}</div>
<div> </div>
<p><strong><code>StorageEstimate</code></strong> 提供对你的域名或Web app的数据存储空间总量和已用量的估计值,该对象实例由{{domxref("StorageManager")}}的{{domxref("StorageManager.estimate", "estimate()")}} 方法返回的{{jsxref("Promise")}}返回.</p>
<p>这些值仅为估计值有多种原因,既有对性能的考虑,也有防止将其作为指纹(fingerprinting)的目的.详情请参看属性.</p>
<h2 id="属性">属性</h2>
<p><em>该对象目前总是同时包含以下两个属性.</em></p>
<dl>
<dt>{{domxref("StorageEstimate.quota", "quota")}} {{securecontext_inline}}</dt>
<dd>用户设备为你的域名或Web app预留的存储空间总大小,且该大小为估计值.虽然实际上可能有比这更多的存储空间,但这时你不应使用那多余的部分.</dd>
<dt>{{domxref("StorageEstimate.usage", "usage")}} {{securecontext_inline}}</dt>
<dd>你的域名或Web app已经使用的存储空间大小,且该大小为估计值.剩余可用空间请综合quota属性计算.</dd>
</dl>
<h2 id="规范">规范</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', '#dictdef-storageestimate', 'StorageEstimate')}}</td>
<td>{{Spec2('Storage')}}</td>
<td>Initial definition.</td>
</tr>
</tbody>
</table>
<h2 id="浏览器兼容性">浏览器兼容性</h2>
<div>{{CompatibilityTable}}</div>
<div id="compat-desktop">
<table class="compat-table">
<tbody>
<tr>
<th>Feature</th>
<th>Chrome</th>
<th>Firefox (Gecko)</th>
<th>Internet Explorer</th>
<th>Microsoft Edge</th>
<th>Opera</th>
<th>Safari (WebKit)</th>
</tr>
<tr>
<td>Basic support</td>
<td>{{CompatChrome(55)}}</td>
<td>{{CompatGeckoDesktop(57)}}</td>
<td>{{CompatUnknown}}</td>
<td>{{CompatUnknown}}</td>
<td>{{CompatOpera(42)}}</td>
<td>{{CompatUnknown}}</td>
</tr>
</tbody>
</table>
</div>
<div id="compat-mobile">
<table class="compat-table">
<tbody>
<tr>
<th>Feature</th>
<th>Android Webview</th>
<th>Chrome for Android</th>
<th>Firefox Mobile (Gecko)</th>
<th>IE Mobile</th>
<th>Opera Mobile</th>
<th>Safari Mobile</th>
</tr>
<tr>
<td>Basic support</td>
<td>{{CompatUnknown}}</td>
<td>{{CompatChrome(55)}}</td>
<td>{{ CompatGeckoMobile(57)}}</td>
<td>{{CompatUnknown}}</td>
<td>{{CompatOperaMobile(42)}}</td>
<td>{{CompatUnknown}}</td>
</tr>
</tbody>
</table>
</div>
<h2 id="相关链接">相关链接</h2>
<ul>
<li><a href="/en-US/docs/Web/API/Storage_API">Storage API</a></li>
<li>{{domxref("StorageManager")}}</li>
<li>{{domxref("StorageManager.estimate()")}}</li>
<li>{{domxref("NavigatorStorage.storage", "navigator.storage")}}</li>
</ul>
|