| 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 20 matching lines...) Expand all Loading... |
| 31 function clickTargetBlankLink() { | 31 function clickTargetBlankLink() { |
| 32 return simulateClick(document.getElementById("tblank_link")); | 32 return simulateClick(document.getElementById("tblank_link")); |
| 33 } | 33 } |
| 34 | 34 |
| 35 function clickNoRefLink() { | 35 function clickNoRefLink() { |
| 36 return simulateClick(document.getElementById("noref_link")); | 36 return simulateClick(document.getElementById("noref_link")); |
| 37 } | 37 } |
| 38 | 38 |
| 39 function testScriptAccessToWindow() { | 39 function testScriptAccessToWindow() { |
| 40 // Grab a reference to the existing foo window and access its location. | 40 // Grab a reference to the existing foo window and access its location. |
| 41 var w = window.open("", "foo"); | 41 try { |
| 42 var url = w.location.href; | 42 var w = window.open("", "foo"); |
| 43 return url != undefined; | 43 var url = w.location.href; |
| 44 return url != undefined; |
| 45 } catch (e) { |
| 46 return false; |
| 47 } |
| 44 } | 48 } |
| 45 | 49 |
| 46 function testCloseWindow() { | 50 function testCloseWindow() { |
| 47 // Grab a reference to the existing foo window and close it. | 51 // Grab a reference to the existing foo window and close it. |
| 48 var w = window.open("", "foo"); | 52 var w = window.open("", "foo"); |
| 49 w.close(); | 53 w.close(); |
| 50 return true; | 54 return true; |
| 51 } | 55 } |
| 52 | 56 |
| 53 // Listen to incoming messages and reply to them. | 57 // Listen to incoming messages and reply to them. |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 <a href="title2.html" id="samesite_tblank_link" target="_blank"> | 93 <a href="title2.html" id="samesite_tblank_link" target="_blank"> |
| 90 same-site target=_blank</a><br> | 94 same-site target=_blank</a><br> |
| 91 <a href="https://REPLACE_WITH_HOST_AND_PORT/files/title2.html" id="tblank_link" | 95 <a href="https://REPLACE_WITH_HOST_AND_PORT/files/title2.html" id="tblank_link" |
| 92 target="_blank">target=_blank</a><br> | 96 target="_blank">target=_blank</a><br> |
| 93 <a href="https://REPLACE_WITH_HOST_AND_PORT/files/title2.html" id="noref_link" | 97 <a href="https://REPLACE_WITH_HOST_AND_PORT/files/title2.html" id="noref_link" |
| 94 rel="noreferrer">rel=noreferrer</a><br> | 98 rel="noreferrer">rel=noreferrer</a><br> |
| 95 | 99 |
| 96 <iframe id="frame1" src="frame_tree/1-1.html"></iframe> | 100 <iframe id="frame1" src="frame_tree/1-1.html"></iframe> |
| 97 | 101 |
| 98 </html> | 102 </html> |
| OLD | NEW |