blob: 2ab8ba1167566cdf70c50bdc8c082c5751778d52 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
<html>
<head>
<script>
function handleStorageEvent(e)
{
parent.log("Subframe received storage event:");
parent.log("Key - " + e.key);
parent.log("New Value - " + e.newValue);
parent.log("Old Value - " + e.oldValue);
parent.log("URI - " + parent.normalizeURL(e.uri));
parent.log("Storage Area - " + ((e.storageArea == window.localStorage) ? "This window's window.localStorage" : "Another window's window.localStorage"));
parent.log("");
if (e.key != "Subframe") {
parent.log("Subframe about to change localStorage...");
localStorage.setItem("Subframe", "SET");
}
}
</script>
</head>
<body onload="window.addEventListener('storage', handleStorageEvent, false);">
This is the subframe which exists to make sure that both frames of a same security origin receive the event for that origin's localStorage object mutating
</body>
</html>
|