2010-11-23 13:24:57 -08:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<script>
|
2011-10-20 09:10:56 -07:00
|
|
|
var res = {};
|
|
|
|
var request = mozIndexedDB.open(parent.location, 2);
|
|
|
|
request.onblocked = function() {
|
2010-11-23 13:24:57 -08:00
|
|
|
res.blockedFired = true;
|
|
|
|
}
|
2011-10-20 09:10:56 -07:00
|
|
|
request.onupgradeneeded = function(e) {
|
|
|
|
var db = e.target.result;
|
|
|
|
res.version = db.version;
|
|
|
|
res.storeCount = db.objectStoreNames.length;
|
|
|
|
|
|
|
|
var trans = request.transaction;
|
2010-11-23 13:24:57 -08:00
|
|
|
trans.objectStore("mystore").get(42).onsuccess = function(e) {
|
2011-01-06 22:21:36 -08:00
|
|
|
res.value = JSON.stringify(e.target.result);
|
2010-11-23 13:24:57 -08:00
|
|
|
}
|
|
|
|
trans.oncomplete = function() {
|
|
|
|
parent.postMessage(JSON.stringify(res), "http://mochi.test:8888");
|
|
|
|
}
|
2011-10-20 09:10:56 -07:00
|
|
|
};
|
2010-11-23 13:24:57 -08:00
|
|
|
|
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
This is page two.
|
|
|
|
</body>
|
|
|
|
</html>
|