dom/tests/mochitest/whatwg/postMessage_hash.html

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     1 <!DOCTYPE html>
     2 <html>
     3 <head>
     4   <title>Hashed kid for test_postMessage_hash.html</title>
     5   <script type="application/javascript">
     6 function receiveMessage(evt)
     7 {
     8   var response = "response-message";
    10   if (window.location.href !== "http://mochi.test:8888/tests/dom/tests/mochitest/whatwg/postMessage_hash.html#hash")
    11     response += " kid-at-wrong-uri(" + window.location.href + ")";
    13   if (evt.origin !== "http://mochi.test:8888")
    14     response += " wrong-origin(" + evt.origin + ")";
    15   if (evt.source !== window.parent)
    16     response += " wrong-source";
    17   if (evt.data !== "from-parent")
    18     response += " wrong-data(" + evt.data + ")";
    19   if (evt.lastEventId !== "")
    20     response += " wrong-lastEventId(" + evt.lastEventId + ")";
    22   window.parent.postMessage(response, "http://mochi.test:8888");
    23 }
    25 window.addEventListener("message", receiveMessage, false);
    26   </script>
    27 </head>
    28 <body>
    29 <p>Kid iframe</p>
    30 </body>
    31 </html>

mercurial