mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
31 lines
881 B
HTML
31 lines
881 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("data:" + globalStorage["example.com"].data, "http://mochi.test:8888");
|
||
|
break;
|
||
|
case "setdata":
|
||
|
var didSucceed = true;
|
||
|
try {
|
||
|
globalStorage["example.com"].data = "value2";
|
||
|
} catch(e) {
|
||
|
didSucceed = false;
|
||
|
}
|
||
|
parent.postMessage("success:" + didSucceed, "http://mochi.test:8888");
|
||
|
parent.postMessage("dataset2:" + globalStorage["example.com"].data, "http://mochi.test:8888");
|
||
|
break;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
addEventListener("message", onMessageReceived, false);
|
||
|
</script>
|
||
|
</body>
|
||
|
</html>
|