dom/indexedDB/test/bfcache_iframe2.html

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 <!DOCTYPE html>
     2 <html>
     3 <head>
     4   <script>
     5   var res = {};
     6   var request = indexedDB.open(parent.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;
    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       parent.postMessage(JSON.stringify(res), "http://mochi.test:8888");
    21     }
    22   };
    24   </script>
    25 </head>
    26 <body>
    27   This is page two.
    28 </body>
    29 </html>

mercurial