gecko/dom/tests/mochitest/globalstorage/iframe_bug614116-2.html

25 lines
681 B
HTML

<!DOCTYPE html>
<html>
<body onload="loaded()">
<script>
function loaded() {
parent.postMessage("loaded", "http://mochi.test:8888");
}
function onMessageReceived(e) {
switch (e.data) {
case "getdata":
parent.postMessage("data2:" + globalStorage["example.com"].data, "http://mochi.test:8888");
break;
case "setdata":
globalStorage["example.com"].data = "value";
parent.postMessage("dataset:" + globalStorage["example.com"].data, "http://mochi.test:8888");
break;
}
}
addEventListener("message", onMessageReceived, false);
</script>
</body>
</html>