tor-browser

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

iframe_005.html (714B)


      1 <!doctype html>
      2 <title>document.write external script into iframe write back into parent</title>
      3 <script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
      4 <iframe id="test"></iframe>
      5 <script>
      6 var t = async_test();
      7 var iframe = document.getElementById("test");
      8 var order = [];
      9 t.step(function() {
     10  order.push(1);
     11  var s = "<script src='iframe_005.js'></script" + ">";
     12  iframe.contentDocument.write(s);
     13  iframe.contentDocument.close();
     14  order.push(2);
     15  assert_array_equals(order, [1,2])
     16 }
     17 );
     18 addEventListener("load", function() {
     19    t.step(function() {
     20      assert_array_equals(order, [1,2,3,4,5])
     21    });
     22    t.done();
     23 }, false);
     24 </script>
     25 <div id="log"></div>