From 235c34993c7b14f783fc8259cc237ac09f0d3e57 Mon Sep 17 00:00:00 2001 From: MDN Date: Fri, 9 Jul 2021 00:38:08 +0000 Subject: [CRON] sync translated content --- .../orphaned/web/api/navigatorstorage/index.html | 71 ++++++++++++++++++++++ .../web/api/navigatorstorage/storage/index.html | 57 +++++++++++++++++ 2 files changed, 128 insertions(+) create mode 100644 files/zh-cn/orphaned/web/api/navigatorstorage/index.html create mode 100644 files/zh-cn/orphaned/web/api/navigatorstorage/storage/index.html (limited to 'files/zh-cn/orphaned/web/api/navigatorstorage') diff --git a/files/zh-cn/orphaned/web/api/navigatorstorage/index.html b/files/zh-cn/orphaned/web/api/navigatorstorage/index.html new file mode 100644 index 0000000000..bc0ef8ba92 --- /dev/null +++ b/files/zh-cn/orphaned/web/api/navigatorstorage/index.html @@ -0,0 +1,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 +--- +

{{securecontext_header}}{{APIRef("Storage")}}

+ +

The NavigatorStorage {{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

+ +

{{AvailableInWorkers}}

+ +

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 IndexedDB. 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.

+ +

Properties

+ +
+
{{domxref("NavigatorStorage.storage", "storage")}} {{readonlyinline}}{{securecontext_inline}}
+
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.
+
+ +

Methods

+ +

The NavigatorStorage mixin has no methods.

+ +

Specifications

+ + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('Storage')}}{{Spec2('Storage')}}Initial definition.
+ +

Browser compatibility

+ + + +

{{Compat("api.NavigatorStorage")}}

+ +

See also

+ + diff --git a/files/zh-cn/orphaned/web/api/navigatorstorage/storage/index.html b/files/zh-cn/orphaned/web/api/navigatorstorage/storage/index.html new file mode 100644 index 0000000000..bfd2cc93d6 --- /dev/null +++ b/files/zh-cn/orphaned/web/api/navigatorstorage/storage/index.html @@ -0,0 +1,57 @@ +--- +title: NavigatorStorage.storage +slug: orphaned/Web/API/NavigatorStorage/storage +tags: + - API + - Navigator + - WorkerNavigator + - 存储 + - 安全上下文 + - 属性 +translation_of: Web/API/NavigatorStorage/storage +original_slug: Web/API/NavigatorStorage/storage +--- +

{{securecontext_header}}{{APIRef("Storage")}}

+ +

 NavigatorStorage.storage 是一个只读属性,返回单例 {{domxref("StorageManager")}} 对象,用于访问当前网站或应用程序的浏览器整体存储功能的。 通过返回的对象,您可以检查和配置数据存储的持久性,并了解您的浏览器使用的大约多少空间用于本地存储。

+ +

语法

+ +
var storageManager = navigator.storage;
+
+ +

返回值

+ +

返回 {{domxref("StorageManager")}} 您可以用来维护数据的持久化存储,以及大致确定有多少空间来存储数据。

+ +

规范

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('Storage', '#navigatorstorage', 'navigator.storage')}}{{Spec2('Storage')}}Initial definition.
+ +

浏览器兼容性

+ +
+

{{Compat("api.NavigatorStorage.storage")}}

+
+ +

相关链接

+ + -- cgit v1.2.3-54-g00ecf