blob: bc0ef8ba9279fd37bf0bb5fc3609b163e3cf22e1 (
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
---
title: NavigatorStorage
slug: orphaned/Web/API/NavigatorStorage
tags:
- API
- Interface
- Mixin
- Navigator
- NavigatorStorage
- NeedsTranslation
- Reference
- Secure context
- Storage
- Storage Standard
- TopicStub
- WorkerNavigator
translation_of: Web/API/NavigatorStorage
original_slug: Web/API/NavigatorStorage
---
<p>{{securecontext_header}}{{APIRef("Storage")}}</p>
<p>The <strong><code>NavigatorStorage</code></strong> {{Glossary("mixin")}} adds to the {{domxref("Navigator")}} and {{domxref("WorkerNavigator")}} interfaces the {{domxref("Navigator.storage")}} property, which provides access to the {{domxref("StorageManager")}} singleton used for controlling the persistence of data stores as well as obtaining information</p>
<p>{{AvailableInWorkers}}</p>
<p>There are many APIs which provide ways for Web content to store data on a user's computer, including {{Glossary("cookies")}}, the Web Storage API ({{domxref("Window.localStorage")}} and {{domxref("Window.sessionStorage")}}), and <a href="/en-US/docs/Web/API/IndexedDB_API">IndexedDB</a>. The Storage Standard is designed to serve as a common basis for the implementation of all of those APIs and storage technologies, so that their constraints and configurations can be understood and controlled using a common set of methods and properties.</p>
<h2 id="Properties">Properties</h2>
<dl>
<dt>{{domxref("NavigatorStorage.storage", "storage")}} {{readonlyinline}}{{securecontext_inline}}</dt>
<dd>Returns the {{domxref("StorageManager")}} singleton object which is used to access the Storage Manager. Through the returned object, you can control persistence of data stores as well as get estimates of how much space is left for your site or appliation to store data.</dd>
</dl>
<h2 id="Methods">Methods</h2>
<p><em>The <code>NavigatorStorage</code></em><em> mixin has no methods.</em></p>
<h2 id="Specifications">Specifications</h2>
<table class="standard-table">
<thead>
<tr>
<th scope="col">Specification</th>
<th scope="col">Status</th>
<th scope="col">Comment</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{SpecName('Storage')}}</td>
<td>{{Spec2('Storage')}}</td>
<td>Initial definition.</td>
</tr>
</tbody>
</table>
<h2 id="Browser_compatibility">Browser compatibility</h2>
<p>{{Compat("api.NavigatorStorage")}}</p>
<h2 id="See_also">See also</h2>
<ul>
<li>{{domxref("Navigator")}}</li>
<li>{{domxref("navigator.storage")}}</li>
<li>{{domxref("WorkerNavigator")}}</li>
<li>{{domxref("StorageManager")}}</li>
</ul>
|