1 <html> 2 <head> 3 <script> 4 5 var secondWindowLog = "Logging from second window:<br>"; 6 7 function log(a) 8 { 9 secondWindowLog += a + "<br>"; 10 } 11 12 function runTest() 13 { 14 if (!window.sessionStorage) { 15 log("window.sessionStorage DOES NOT exist"); 16 return; 17 } 18 19 log("Value for FOO is " + window.sessionStorage.getItem("FOO")); 20 window.sessionStorage.setItem("FOO", "BAR-NEWWINDOW"); 21 log("Value for FOO after changing my own copy is " + window.sessionStorage.getItem("FOO")); 22 23 log("Value for FOO in my opening window is " + window.opener.sessionStorage.getItem("FOO")); 24 25 window.opener.log(secondWindowLog); 26 27 if (window.layoutTestController) 28 layoutTestController.notifyDone(); 29 } 30 31 </script> 32 </head> 33 <body onload="runTest();"> 34 This is a new window to make sure there is a copy of the previous window's sessionStorage, and that they diverge after a change<br> 35 </body> 36 </html> 37