1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31

content / test / data / page_with_iframe_and_link.html [blame]

<html>

 <head><title>Page with iframe and link</title>
 <script>
  function simulateClick(target) {
    var evt = document.createEvent("MouseEvents");
    evt.initMouseEvent("click", true, true, window,
                       0, 0, 0, 0, 0, false, false,
                       false, false, 0, null);

    return target.dispatchEvent(evt);
  }

  function setPortNumber(portNumber) {
    var link = document.getElementById("cross_site_link");
    link.setAttribute("href", "http://foo.com:" + portNumber + "/title2.html");
    return true;
  }

  function clickCrossSiteLink() {
    return simulateClick(document.getElementById("cross_site_link"));
  }
 </script>
 </head>

<a href="http://foo.com/title2.html" id="cross_site_link">cross-site</a><br>

<p>This page has an iframe. Yay for iframes!
<p><iframe src="about:blank"></iframe>

</html>