|
1 <!DOCTYPE html> |
|
2 <html> |
|
3 <head> |
|
4 <script> |
|
5 var request = indexedDB.open(parent.location, 1); |
|
6 request.onupgradeneeded = function(e) { |
|
7 var db = e.target.result; |
|
8 // This should never be called |
|
9 db.onversionchange = function(e) { |
|
10 db.transaction(["mystore"]).objectStore("mystore").put({ hello: "fail" }, 42); |
|
11 } |
|
12 var trans = e.target.transaction; |
|
13 if (db.objectStoreNames.contains("mystore")) { |
|
14 db.deleteObjectStore("mystore"); |
|
15 } |
|
16 var store = db.createObjectStore("mystore"); |
|
17 store.add({ hello: "world" }, 42); |
|
18 trans.oncomplete = function() { |
|
19 parent.postMessage("go", "http://mochi.test:8888"); |
|
20 } |
|
21 }; |
|
22 </script> |
|
23 </head> |
|
24 <body> |
|
25 This is page one. |
|
26 </body> |
|
27 </html> |