tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

basicCacheAPI_PBM.html (586B)


      1 <html>
      2    <head>
      3        <script>
      4            async function ensureCache(name) {
      5                if (!window.testCache) {
      6                    window.testCache = await caches.open(name);
      7                }
      8                return window.testCache;
      9            };
     10 
     11            function releaseCache() {
     12                window.testCache = null;
     13            }
     14 
     15            async function addDataIntoCache(name, request, response) {
     16                let cache = await ensureCache(name);
     17                return cache.put(request, response);
     18            };
     19        </script>
     20    </head>
     21 </html>