tor-browser

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

targeting-with-embedded-null-in-target.html (999B)


      1 <!doctype html>
      2 <html>
      3 <head>
      4  <meta charset="utf-8">
      5  <title>Targeting with embedded null in target</title>
      6  <script src="/resources/testharness.js"></script>
      7  <script src="/resources/testharnessreport.js"></script>
      8 </head>
      9 <body>
     10  <iframe name="abc">
     11  </iframe>
     12  <a href="resources/message-parent.html" target="abc">Click me</a>
     13  <script>
     14    var t = async_test();
     15    var target_name = "abc\u0000def";
     16 
     17    onmessage = t.step_func_done(function (e) {
     18        assert_equals(e.data.name, target_name,
     19                      "Should come from a window with the right name");
     20        assert_equals(e.source, frames[1],
     21                      "Should come frome the right window");
     22    });
     23 
     24    t.step(function() {
     25        var iframe = document.createElement("iframe");
     26        iframe.setAttribute("name", target_name);
     27        document.body.appendChild(iframe);
     28        var a = document.querySelector("a");
     29        a.target = target_name;
     30        a.click();
     31    });
     32  </script>
     33 </body>
     34 </html>