tor-browser

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

009.html (918B)


      1 <!doctype html>
      2 <title>Link with onclick form submit 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 <form target="test" action="javascript:(function() {document.write('<script>parent.postMessage(&quot;write&quot;, &quot;*&quot;)</script>'); return '<script>parent.postMessage(&quot;click&quot;, &quot;*&quot;)</script>'})()"></form>
      8 <a target="test" onclick="document.forms[0].submit()" href="resources/href.html">Test</a>
      9 <script>
     10 var t = async_test();
     11 var events = [];
     12 t.step(function() {
     13  document.getElementsByTagName("a")[0].click()});
     14 onmessage = t.step_func(
     15  function(e) {
     16    events.push(e.data);
     17    if (events.length === 2) {
     18      assert_array_equals(events, ["write", "href"]);
     19      t.done();
     20    }
     21  });
     22 </script>