https://github.com/mozilla/gecko-dev
Raw File
Tip revision: 313ee0f00756c8739b2d28ae0f5d620c008239e0 authored by Ryan VanderMeulen on 29 July 2015, 14:14:54 UTC
Added tag B2G_2_0M_END for changeset 4e82c466cac4 on a CLOSED TREE
Tip revision: 313ee0f
file1_bug629227.html
<!DOCTYPE html>
<html>
  <head>
    <script>
      function doIt() {
        var doc = window.frames[0].document;
        var ok = (doc.form1 == doc.getElementById("test1"));
        window.parent.postMessage(
          JSON.stringify({ ok: ok,
                           reason: "Should be able to get named items by name" }),
                         "*");
        window.parent.postMessage("finish", "*");
      }

      window.onmessage = function(ev) {
        if (ev.data == "start") {
          doIt();
        }
      }

      document.domain = "example.org";
    </script>
  </head>
  <body>
    <iframe id="subframe"></iframe>
    <script>
      document.getElementById("subframe").src =
        "http://test2.example.org" +
        location.pathname.replace(/file1_bug629227.html/, "file2_bug629227.html");
    </script>
  </body>
</html>
back to top