1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31

content / test / data / page_with_meta_refresh_frame.html [blame]

<!doctype html>
<html>
  <head>
    <title>test</title>
    <script>
      window.addEventListener("load",  populateIframe);
      function populateIframe() {
        html = "<!doctype html>" +
        "<html>" +
        "  <head>" +
        "    <meta http-equiv=\"refresh\" content=\"0\">" +
        "    <title>meta refresh in iframe reloads parent</title>" +
        "  </head>" +
        "  <body>" +
        "    iframe" +
        "  </body>" +
        "</html>";
        doc = document.getElementById("frame").contentDocument;
        // Opening the IFrame's document to write to it will cause the IFrame's 
        // document's URL to be set to the URL of the parent document 
        doc.open();
        doc.write(html);
        doc.close();
      }
    </script>
  </head>
  <body>
    <div>parent</div>
    <iframe id="frame"></iframe>
  </body>
</html>