summaryrefslogtreecommitdiffstats
path: root/chrome/test/data/click-noreferrer-links.html
blob: f6ae2955a953ddf4cad5165c5980daee2800c768 (plain)
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
32
33
34
35
36
37
<html>

 <head><title>Click noreferrer links</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 clickNoRefTargetBlankLink() {
    return simulateClick(document.getElementById("noref_and_tblank_link"));
  }

  function clickTargetBlankLink() {
    return simulateClick(document.getElementById("tblank_link"));
  }

  function clickNoRefLink() {
    return simulateClick(document.getElementById("noref_link"));
  }

 </script>
 </head>

<a href="https://127.0.0.1:9443/files/title2.html" id="noref_and_tblank_link"
   rel="noreferrer" target="_blank">rel=noreferrer and target=_blank</a><br>
<a href="https://127.0.0.1:9443/files/title2.html" id="tblank_link"
   target="_blank">target=_blank</a><br>
<a href="https://127.0.0.1:9443/files/title2.html" id="noref_link"
   rel="noreferrer">rel=noreferrer</a><br>

</html>