Source code

Revision control

Copy as Markdown

Other Tools

<!DOCTYPE html>
<html manifest="manifest.appcache">
<head>
<meta charset="utf-8">
<meta http-equiv="Cache-Control" content="public" />
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1, maximum-scale=1">
<title>Site Data Test</title>
</head>
<body>
<h1>Site Data Test</h1>
<script type="text/javascript">
let request = indexedDB.open("TestDatabase", 1);
request.onupgradeneeded = function(e) {
let db = e.target.result;
db.createObjectStore("TestStore", { keyPath: "id" });
};
request.onsuccess = function(e) {
let db = e.target.result;
let tx = db.transaction("TestStore", "readwrite");
let store = tx.objectStore("TestStore");
store.put({ id: "test_id", description: "Site Data Test"});
tx.oncomplete = () => document.dispatchEvent(new CustomEvent("test-indexedDB-done", {bubbles: true, cancelable: false}));
};
</script>
</body>
</html>