Skip to content

Commit

Permalink
Create windowcache.html
Browse files Browse the repository at this point in the history
  • Loading branch information
Thorin-Oakenpants authored Nov 14, 2023
1 parent 82dc6d6 commit 0fab2a2
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions windowcache.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>window cache keys</title>
</head>

<body>
<div>
result: <span id="result"></span>
</div>

<script>
'use strict';

const get_window_cache = () => new Promise(resolve => {
// Uncaught (in promise) DOMException: The operation is insecure.
if (location.protocol !== "https:") {
return resolve("n/a")
}
// PB mode:
try {
Promise.all([
window.caches.keys()
]).then(function(results){
console.log(results)
addDataDisplay(6, METRIC, zS)
return resolve("success")
})
} catch(e) {
return resolve(e+"")
}
})

Promise.all([
get_window_cache(),
]).then(function(results){
document.getElementById("result").innerHTML = results[0]
})

</script>
</body>
</html>

0 comments on commit 0fab2a2

Please sign in to comment.