tor-browser

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

011.html (853B)


      1 <!doctype html>
      2 <title>Link with onclick navigation to javascript url with document.write and href navigation </title>
      3 <script src="/resources/testharness.js"></script>
      4 <script src="/resources/testharnessreport.js"></script>
      5 <div id="log"></div>
      6 <iframe id="test" name="test"></iframe>
      7 <a target="test" onclick="javascript:(function() {document.write('<script>parent.postMessage(&quot;write&quot;, &quot;*&quot;)</script>'); return '<script>parent.postMessage(&quot;click&quot;, &quot;*&quot;)</script>'})()" href="resources/href.html">Test</a>
      8 <script>
      9 var t = async_test();
     10 var events = [];
     11 t.step(function() {
     12  document.getElementsByTagName("a")[0].click()});
     13 onmessage = t.step_func(
     14  function(e) {
     15    events.push(e.data);
     16    if (events.length === 2) {
     17      assert_array_equals(events, ["write", "href"]);
     18      t.done();
     19    }
     20  });
     21 </script>