• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<html>
2<head>
3<script>
4
5var secondWindowLog = "Logging from second window:<br>";
6
7function log(a)
8{
9    secondWindowLog += a + "<br>";
10}
11
12function runTest()
13{
14    if (!window.localStorage) {
15        log("window.localStorage DOES NOT exist");
16        return;
17    }
18
19    log("Value for FOO is " + window.localStorage.getItem("FOO"));
20    window.localStorage.setItem("FOO", "BAR-NEWWINDOW");
21    log("Value for FOO after changing my own copy is " + window.localStorage.getItem("FOO"));
22
23    log("Value for FOO in my opening window is " + window.opener.localStorage.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();">
34This is a new window to make sure the localStorage object for an origin is shared between multiple windows.<br>
35</body>
36</html>
37