summaryrefslogtreecommitdiffstats
path: root/LayoutTests/storage/domstorage/sessionstorage/resources/iframe-events-second.html
blob: 2d7b004b8f864c90a5c47c06fe0eeb18662f4d53 (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.sessionStorage) ? "This window's window.sessionStorage" : "Another window's window.sessionStorage"));
    parent.log("");
    
    if (e.key != "Subframe") {
        parent.log("Subframe about to change sessionStorage...");
        sessionStorage.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 sessionStorage object mutating
</body>
</html>