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