dom/tests/mochitest/sessionstorage/file_http.html

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 <html>
     2 <head>
     3 <script>
     5 window.addEventListener("message", onMessageReceived, false);
     7 function postMsg(msg)
     8 {
     9   parent.postMessage(msg, "http://mochi.test:8888");
    10 }
    12 function onMessageReceived(event)
    13 {
    14   if (event.data == "check") {
    15     postMsg(sessionStorage.getItem("foo"));
    17     var gotValue = "threw";
    18     try {
    19       gotValue = sessionStorage.getItem("foo-https");
    20     } catch (e) {
    21     }
    23     postMsg(gotValue);
    25     postMsg("the end");
    26   }
    27 }
    29 function start()
    30 {
    31   sessionStorage.setItem("foo", "insecure");
    32   postMsg(sessionStorage.getItem("foo"));
    33 }
    35 </script>
    36 </head>
    37 <body onload="start();">
    38 insecure
    39 </body>
    40 </html>

mercurial