From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../webextensions/api/storage/local/index.html | 84 ++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 files/ja/mozilla/add-ons/webextensions/api/storage/local/index.html (limited to 'files/ja/mozilla/add-ons/webextensions/api/storage/local') diff --git a/files/ja/mozilla/add-ons/webextensions/api/storage/local/index.html b/files/ja/mozilla/add-ons/webextensions/api/storage/local/index.html new file mode 100644 index 0000000000..e69759effd --- /dev/null +++ b/files/ja/mozilla/add-ons/webextensions/api/storage/local/index.html @@ -0,0 +1,84 @@ +--- +title: storage.local +slug: Mozilla/Add-ons/WebExtensions/API/storage/local +translation_of: Mozilla/Add-ons/WebExtensions/API/storage/local +--- +
{{AddonSidebar()}}
+ +

local ストレージ領域を指します。localストレージ内のアイテムはその拡張機能がインストールされたマシン内で利用できます。

+ +

ブラウザーは拡張機能がローカルストレージエリアに保存できるデータ量を制限します。

+ + + +

拡張機能をアンインストールすると、関連するローカルストレージは削除されます。

+ +

またFirefoxでは、"about:config"で"keepUuidOnUninstall"と"keepStorageOnUninstall"の設定をtrueにすることで、アンインストール時にデータが削除されることを防ぐことができます。 この機能は拡張機能開発のテストのために提供されています。拡張機能自身ではこれらの設定を変更できません。

+ +

このAPIは {{domxref("Window.localStorage")}}に似ていますが、拡張機能のコード内でWindow.localStorageを使用することは推奨されません。これはユーザがプライバシーのために履歴とデータを削除するなど、FirefoxはlocalStorage APIを用いて拡張機能が保存したデータを削除することがあるためです。

+ +

関数

+ +

localオブジェクトは{{WebExtAPIRef("storage.StorageArea")}} 型で定義された関数を実装しています。

+ +
+
{{WebExtAPIRef("storage.StorageArea.get()")}}
+
ストレージ領域から 1つ以上のアイテムを取得します。
+
{{WebExtAPIRef("storage.StorageArea.getBytesInUse()")}}
+
1つ以上のストレージ領域内に格納されたアイテムが占めるストレージ空間をバイト単位で取得します。
+
{{WebExtAPIRef("storage.StorageArea.set()")}}
+
1つ以上のアイテムをストレージ領域に格納します。既にアイテムが存在していれば値は上書きされます。 値を格納したとき{{WebExtAPIRef("storage.onChanged")}}イベントが発火します。
+
{{WebExtAPIRef("storage.StorageArea.remove()")}}
+
ストレージ領域内の1つ以上のアイテムを削除します。
+
{{WebExtAPIRef("storage.StorageArea.clear()")}}
+
ストレージ領域内の全てのアイテムを削除します。
+
+ +

ブラウザ互換状況

+ + + +

{{Compat("webextensions.api.storage.local")}}

+ +

{{WebExtExamples}}

+ +
Acknowledgements + +

このAPIはChromiumの chrome.storage APIに基づいています。また、このドキュメントは storage.jsonにおける Chromium のコードに基づいています。

+ +

Microsoft Edge での実装状況は Microsoft Corporation から提供されたものであり、ここでは Creative Commons Attribution 3.0 United States License に従っています。

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