OLD | NEW |
---|---|
1 <html> | 1 <html> |
2 | 2 |
3 <head><title>Click noreferrer links</title> | 3 <head><title>Click noreferrer links</title> |
4 <script> | 4 <script> |
5 function simulateClick(target) { | 5 function simulateClick(target) { |
6 var evt = document.createEvent("MouseEvents"); | 6 var evt = document.createEvent("MouseEvents"); |
7 evt.initMouseEvent("click", true, true, window, | 7 evt.initMouseEvent("click", true, true, window, |
8 0, 0, 0, 0, 0, false, false, | 8 0, 0, 0, 0, 0, false, false, |
9 false, false, 0, null); | 9 false, false, 0, null); |
10 | 10 |
11 return target.dispatchEvent(evt); | 11 return target.dispatchEvent(evt); |
12 } | 12 } |
13 | 13 |
14 function clickNoRefTargetBlankLink() { | 14 function clickNoRefTargetBlankLink() { |
15 return simulateClick(document.getElementById("noref_and_tblank_link")); | 15 return simulateClick(document.getElementById("noref_and_tblank_link")); |
16 } | 16 } |
17 | 17 |
18 function clickSameSiteNoRefTargetedLink() { | 18 function clickSameSiteNoRefTargetedLink() { |
19 return simulateClick( | 19 return simulateClick( |
20 document.getElementById("samesite_noref_and_targeted_link")); | 20 document.getElementById("samesite_noref_and_targeted_link")); |
21 } | 21 } |
22 | 22 |
23 function clickSameSiteTargetedLink() { | 23 function clickSameSiteTargetedLink() { |
24 return simulateClick(document.getElementById("samesite_targeted_link")); | 24 return simulateClick(document.getElementById("samesite_targeted_link")); |
25 } | 25 } |
26 | 26 |
27 function clickBlankTargetedLink() { | |
Charlie Reis
2014/12/11 00:43:39
nit: Let's move this after clickNoRefLink(), since
lfg
2014/12/11 23:55:24
Done.
| |
28 return simulateClick(document.getElementById("blank_targeted_link")); | |
29 } | |
30 | |
27 function clickSameSiteTargetBlankLink() { | 31 function clickSameSiteTargetBlankLink() { |
28 return simulateClick(document.getElementById("samesite_tblank_link")); | 32 return simulateClick(document.getElementById("samesite_tblank_link")); |
29 } | 33 } |
30 | 34 |
31 function clickTargetBlankLink() { | 35 function clickTargetBlankLink() { |
32 return simulateClick(document.getElementById("tblank_link")); | 36 return simulateClick(document.getElementById("tblank_link")); |
33 } | 37 } |
34 | 38 |
35 function clickNoRefLink() { | 39 function clickNoRefLink() { |
36 return simulateClick(document.getElementById("noref_link")); | 40 return simulateClick(document.getElementById("noref_link")); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
83 </head> | 87 </head> |
84 | 88 |
85 <a href="http://REPLACE_WITH_HOST_AND_PORT/files/title2.html" | 89 <a href="http://REPLACE_WITH_HOST_AND_PORT/files/title2.html" |
86 id="noref_and_tblank_link" rel="noreferrer" target="_blank"> | 90 id="noref_and_tblank_link" rel="noreferrer" target="_blank"> |
87 rel=noreferrer and target=_blank</a><br> | 91 rel=noreferrer and target=_blank</a><br> |
88 <a href="title2.html" id="samesite_noref_and_targeted_link" | 92 <a href="title2.html" id="samesite_noref_and_targeted_link" |
89 rel="noreferrer" target="foo"> | 93 rel="noreferrer" target="foo"> |
90 same-site rel=noreferrer and target=foo</a><br> | 94 same-site rel=noreferrer and target=foo</a><br> |
91 <a href="navigate_opener.html" id="samesite_targeted_link" target="foo"> | 95 <a href="navigate_opener.html" id="samesite_targeted_link" target="foo"> |
92 same-site target=foo</a><br> | 96 same-site target=foo</a><br> |
97 <a href="about:blank" id="blank_targeted_link" target="foo"> | |
98 blank_targeted_link=foo</a><br> | |
Charlie Reis
2014/12/11 00:43:39
Same here (move after noref_link).
lfg
2014/12/11 23:55:24
Done.
| |
93 <a href="title2.html" id="samesite_tblank_link" target="_blank"> | 99 <a href="title2.html" id="samesite_tblank_link" target="_blank"> |
94 same-site target=_blank</a><br> | 100 same-site target=_blank</a><br> |
95 <a href="http://REPLACE_WITH_HOST_AND_PORT/files/title2.html" id="tblank_link" | 101 <a href="http://REPLACE_WITH_HOST_AND_PORT/files/title2.html" id="tblank_link" |
96 target="_blank">target=_blank</a><br> | 102 target="_blank">target=_blank</a><br> |
97 <a href="http://REPLACE_WITH_HOST_AND_PORT/files/title2.html" id="noref_link" | 103 <a href="http://REPLACE_WITH_HOST_AND_PORT/files/title2.html" id="noref_link" |
98 rel="noreferrer">rel=noreferrer</a><br> | 104 rel="noreferrer">rel=noreferrer</a><br> |
99 | 105 |
100 <iframe id="frame1" src="frame_tree/1-1.html"></iframe> | 106 <iframe id="frame1" src="frame_tree/1-1.html"></iframe> |
101 | 107 |
102 </html> | 108 </html> |
OLD | NEW |