From 3b0f3b4310d7cad3bd61d0fbfcbc2f81d9cc6713 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Sat, 8 May 2021 14:41:17 +0200 Subject: Fix a typo in the example for CacheStorage.keys() (#781) Follow-up to https://github.com/mdn/content/pull/4790 on the main repo Signed-off-by: Thomas Citharel --- files/ja/web/api/cachestorage/keys/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'files/ja/web/api/cachestorage') diff --git a/files/ja/web/api/cachestorage/keys/index.html b/files/ja/web/api/cachestorage/keys/index.html index 02311df3a8..d7983bdff6 100644 --- a/files/ja/web/api/cachestorage/keys/index.html +++ b/files/ja/web/api/cachestorage/keys/index.html @@ -37,7 +37,7 @@ translation_of: Web/API/CacheStorage/keys

このコードスニペットでは、{{domxref("ServiceWorkerGlobalScope.onactivate", "activate")}} イベントを待機してから、新しいサービスワーカーがアクティブ化される前に、古い未使用のキャッシュをクリアする {{domxref("ExtendableEvent.waitUntil","waitUntil()")}} ブロックを実行します。 ここに、保持したいキャッシュの名前を含むホワイトリスト(cacheWhitelist)があります。 keys() を使用して {{domxref("CacheStorage")}} オブジェクトのキャッシュのキーを返し、各キーをチェックしてホワイトリストにあるかどうかを確認します。 ない場合は、{{domxref("CacheStorage.delete()")}} を使用して削除します。

-
then.addEventListener('activate', function(event) {
+
this.addEventListener('activate', function(event) {
   var cacheWhitelist = ['v2'];
 
   event.waitUntil(
-- 
cgit v1.2.3-54-g00ecf