mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-04 14:27:30 +09:00
import FIREFOX_52_6_0esr_RELEASE from mozilla-esr52 hg repo
This commit is contained in:
commit
dcd9973243
150858 changed files with 23884658 additions and 0 deletions
43
dom/indexedDB/test/leaving_page_iframe.html
Normal file
43
dom/indexedDB/test/leaving_page_iframe.html
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<script>
|
||||
var db;
|
||||
function startDBWork() {
|
||||
indexedDB.open(parent.location, 1).onupgradeneeded = function(e) {
|
||||
db = e.target.result;
|
||||
var trans = e.target.transaction;
|
||||
if (db.objectStoreNames.contains("mystore")) {
|
||||
db.deleteObjectStore("mystore");
|
||||
}
|
||||
var store = db.createObjectStore("mystore");
|
||||
store.add({ hello: "world" }, 42);
|
||||
e.target.onsuccess = madeMod;
|
||||
};
|
||||
}
|
||||
|
||||
function madeMod() {
|
||||
var trans = db.transaction(["mystore"], "readwrite");
|
||||
var store = trans.
|
||||
objectStore("mystore");
|
||||
trans.oncomplete = function() {
|
||||
parent.postMessage("didcommit", "*");
|
||||
}
|
||||
|
||||
store.put({ hello: "officer" }, 42).onsuccess = function(e) {
|
||||
// Make this transaction run until the end of time or until the page is
|
||||
// navigated away, whichever comes first.
|
||||
function doGet() {
|
||||
store.get(42).onsuccess = doGet;
|
||||
}
|
||||
doGet();
|
||||
document.location = "about:blank";
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body onload="startDBWork();">
|
||||
This is page one.
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue