tor-browser

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

ignore-child-fenced-frame-onload-event-inner.html (1180B)


      1 <!DOCTYPE html>
      2 <title>child frame with delayed onload event</title>
      3 <script src="/resources/testharness.js"></script>
      4 <script src="/resources/testharnessreport.js"></script>
      5 <script src="utils.js"></script>
      6 
      7 <body>
      8 </body>
      9 <script>
     10  (function () {
     11    const [element_type, toplevel_loaded_key, result_key] = parseKeylist();
     12 
     13    // Delays the onload event of the iframe for 2 sec.
     14    if (element_type == "iframe") {
     15      const img = document.createElement("img");
     16      img.src = "/common/square.png?pipe=trickle(d2)";
     17      document.body.appendChild(img);
     18      return;
     19    }
     20 
     21    const iframe = document.createElement('iframe');
     22    iframe.src = generateURL("ignore-child-fenced-frame-onload-event-inner." +
     23      "html", ["iframe"]);
     24    document.body.append(iframe);
     25 
     26    let iframe_loaded = false;
     27    let result = "passed";
     28    window.onload = async function () {
     29      const toplevel_loaded = await readValueFromServer(toplevel_loaded_key);
     30      if (!toplevel_loaded.status || !iframe_loaded)
     31        result = "failed";
     32      writeValueToServer(result_key, result);
     33    }
     34 
     35    iframe.onload = function () {
     36      iframe_loaded = true;
     37    }
     38  })();
     39 </script>
     40 
     41 </html>