| 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 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 | 26 |
| 27 function clickTargetBlankLink() { | 27 function clickTargetBlankLink() { |
| 28 return simulateClick(document.getElementById("tblank_link")); | 28 return simulateClick(document.getElementById("tblank_link")); |
| 29 } | 29 } |
| 30 | 30 |
| 31 function clickNoRefLink() { | 31 function clickNoRefLink() { |
| 32 return simulateClick(document.getElementById("noref_link")); | 32 return simulateClick(document.getElementById("noref_link")); |
| 33 } | 33 } |
| 34 | 34 |
| 35 function testScriptAccessToWindow() { | 35 function testScriptAccessToWindow() { |
| 36 // Grab a reference to the existing foo window and access its location. |
| 36 var w = window.open("", "foo"); | 37 var w = window.open("", "foo"); |
| 37 var url = w.location.href; | 38 var url = w.location.href; |
| 38 return url != undefined; | 39 return url != undefined; |
| 39 } | 40 } |
| 40 | 41 |
| 42 function testCloseWindow() { |
| 43 // Grab a reference to the existing foo window and close it. |
| 44 var w = window.open("", "foo"); |
| 45 w.close(); |
| 46 return true; |
| 47 } |
| 48 |
| 41 </script> | 49 </script> |
| 42 </head> | 50 </head> |
| 43 | 51 |
| 44 <a href="https://REPLACE_WITH_HOST_AND_PORT/files/title2.html" | 52 <a href="https://REPLACE_WITH_HOST_AND_PORT/files/title2.html" |
| 45 id="noref_and_tblank_link" rel="noreferrer" target="_blank"> | 53 id="noref_and_tblank_link" rel="noreferrer" target="_blank"> |
| 46 rel=noreferrer and target=_blank</a><br> | 54 rel=noreferrer and target=_blank</a><br> |
| 47 <a href="title2.html" id="samesite_noref_and_targeted_link" | 55 <a href="title2.html" id="samesite_noref_and_targeted_link" |
| 48 rel="noreferrer" target="foo"> | 56 rel="noreferrer" target="foo"> |
| 49 same-site rel=noreferrer and target=foo</a><br> | 57 same-site rel=noreferrer and target=foo</a><br> |
| 50 <a href="navigate_opener.html" id="samesite_targeted_link" target="foo"> | 58 <a href="navigate_opener.html" id="samesite_targeted_link" target="foo"> |
| 51 <a href="https://REPLACE_WITH_HOST_AND_PORT/files/title2.html" id="tblank_link" | 59 <a href="https://REPLACE_WITH_HOST_AND_PORT/files/title2.html" id="tblank_link" |
| 52 target="_blank">target=_blank</a><br> | 60 target="_blank">target=_blank</a><br> |
| 53 <a href="https://REPLACE_WITH_HOST_AND_PORT/files/title2.html" id="noref_link" | 61 <a href="https://REPLACE_WITH_HOST_AND_PORT/files/title2.html" id="noref_link" |
| 54 rel="noreferrer">rel=noreferrer</a><br> | 62 rel="noreferrer">rel=noreferrer</a><br> |
| 55 | 63 |
| 56 </html> | 64 </html> |
| OLD | NEW |