2010-11-23 13:24:57 -08:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<script>
|
2012-06-29 09:48:35 -07:00
|
|
|
var request = indexedDB.open(parent.location, 1);
|
2011-10-20 09:10:56 -07:00
|
|
|
request.onupgradeneeded = function(e) {
|
|
|
|
var db = e.target.result;
|
|
|
|
// This should never be called
|
|
|
|
db.onversionchange = function(e) {
|
|
|
|
db.transaction(["mystore"]).objectStore("mystore").put({ hello: "fail" }, 42);
|
|
|
|
}
|
|
|
|
var trans = e.target.transaction;
|
2010-11-23 13:24:57 -08:00
|
|
|
if (db.objectStoreNames.contains("mystore")) {
|
|
|
|
db.deleteObjectStore("mystore");
|
|
|
|
}
|
2010-12-21 08:02:01 -08:00
|
|
|
var store = db.createObjectStore("mystore");
|
2010-11-23 13:24:57 -08:00
|
|
|
store.add({ hello: "world" }, 42);
|
|
|
|
trans.oncomplete = function() {
|
|
|
|
parent.postMessage("go", "http://mochi.test:8888");
|
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
This is page one.
|
|
|
|
</body>
|
|
|
|
</html>
|