tor-browser

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

dynamic-append.html (834B)


      1 <!DOCTYPE html>
      2 <meta charset="utf-8">
      3 <title>Meta refresh applies even when dynamically appended</title>
      4 <script src="/resources/testharness.js"></script>
      5 <script src="/resources/testharnessreport.js"></script>
      6 <link rel="help" href="https://html.spec.whatwg.org/multipage/semantics.html#pragma-directives">
      7 
      8 <div id="log"></div>
      9 
     10 <script>
     11 "use strict";
     12 setup({ single_test: true });
     13 
     14 const iframe = document.createElement("iframe");
     15 let loadCount = 0;
     16 
     17 iframe.onload = () => {
     18  ++loadCount;
     19  const iDocument = iframe.contentDocument;
     20 
     21  if (loadCount === 1) {
     22    iDocument.body.innerHTML = `<meta http-equiv="refresh" content="1; url=foo">`;
     23  } else if (loadCount === 2) {
     24    assert_equals(iDocument.body.textContent.trim(), "foo");
     25    done();
     26  }
     27 };
     28 
     29 iframe.src = "support/ufoo";
     30 document.body.appendChild(iframe);
     31 </script>