StorageArea.clear()
全てのアイテムをストレージ領域から削除します。
この関数は Promise
を返す非同期関数です。
構文
js
var clearing = browser.storage.<storageType>.clear()
<storageType>
は storage.sync
または storage.local
の書き込み可能なストレージタイプです。
引数
なし
返り値
成功時は引数の無い Promise
を返します。 失敗した場合 promise はエラーメッセージと共にリジェクトされます。
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | ||||||
---|---|---|---|---|---|---|---|
clear |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- See implementation notes.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
例
js
function onCleared() {
console.log("OK");
}
function onError(e) {
console.log(e);
}
var clearStorage = browser.storage.local.clear();
clearStorage.then(onCleared, onError);
メモ:
この API は Chromium の chrome.storage
API に基づいています。また、このドキュメントは storage.json
における Chromium のコードに基づいています。Microsoft Edge での実装状況は Microsoft Corporation から提供されたものであり、ここでは Creative Commons Attribution 3.0 United States License に従っています。