2009-05-28 16:15:26 -07:00
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<script>
|
|
|
|
|
|
|
|
window.addEventListener("message", onMessageReceived, false);
|
|
|
|
|
|
|
|
function postMsg(msg)
|
|
|
|
{
|
2010-03-12 13:53:36 -08:00
|
|
|
parent.postMessage(msg, "http://mochi.test:8888");
|
2009-05-28 16:15:26 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
function onMessageReceived(event)
|
|
|
|
{
|
|
|
|
if (event.data == "check") {
|
|
|
|
postMsg(sessionStorage.getItem("foo"));
|
|
|
|
|
|
|
|
var gotValue = "threw";
|
|
|
|
try {
|
|
|
|
gotValue = sessionStorage.getItem("foo-https");
|
|
|
|
} catch (e) {
|
|
|
|
}
|
|
|
|
|
|
|
|
postMsg(gotValue);
|
|
|
|
|
|
|
|
postMsg("the end");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function start()
|
|
|
|
{
|
|
|
|
sessionStorage.setItem("foo", "insecure");
|
|
|
|
postMsg(sessionStorage.getItem("foo"));
|
|
|
|
}
|
|
|
|
|
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body onload="start();">
|
|
|
|
insecure
|
|
|
|
</body>
|
|
|
|
</html>
|