tor-browser

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

012.html (1141B)


      1 <!doctype html>
      2 <title>Link with onclick navigation to javascript url with delayed 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 <!-- XXX: What is this test trying to do?  It's navigating the subframe, but
      8     doing a write() to _this_ document, and the "javascript:" in there is
      9     completely a red herring: it's a label, not a protocol.  There is no
     10     javascript url involved here, unlike what the title claims! -->
     11 <a target="test" onclick="javascript:(function() {var x = new XMLHttpRequest(); x.open('GET', 'blank.html?pipe=trickle(d2)', false); x.send(); document.write('write<script>parent.postMessage(&quot;write&quot;, &quot;*&quot;)</script>'); return '<script>parent.postMessage(&quot;click&quot;, &quot;*&quot;)</script>'})()" href="href.html">Test</a>
     12 <script>
     13 var t = async_test();
     14 t.step(function() {document.getElementsByTagName("a")[0].click()});
     15 onmessage = t.step_func(
     16  function(e) {
     17    assert_equals(e.data, "href");
     18    t.done();
     19  });
     20 </script>