bfcache_page2.html (678B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <script> 5 var res = {}; 6 var request = indexedDB.open(opener.location, 2); 7 request.onblocked = function() { 8 res.blockedFired = true; 9 }; 10 request.onupgradeneeded = function(e) { 11 var db = e.target.result; 12 res.version = db.version; 13 res.storeCount = db.objectStoreNames.length; 14 15 var trans = request.transaction; 16 trans.objectStore("mystore").get(42).onsuccess = function(e) { 17 res.value = JSON.stringify(e.target.result); 18 }; 19 trans.oncomplete = function() { 20 opener.postMessage(JSON.stringify(res), "http://mochi.test:8888"); 21 }; 22 }; 23 24 </script> 25 </head> 26 <body> 27 This is page two. 28 </body> 29 </html>