tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

postMessage_hash.html (911B)


      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";
      9 
     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 + ")";
     12 
     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 + ")";
     21 
     22  window.parent.postMessage(response, "http://mochi.test:8888");
     23 }
     24 
     25 window.addEventListener("message", receiveMessage);
     26  </script>
     27 </head>
     28 <body>
     29 <p>Kid iframe</p>
     30 </body>
     31 </html>