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 21 matching lines...) Expand all Loading... |
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 var w = window.open("", "foo"); |
42 var url = w.location.href; | 42 try { |
43 return url != undefined; | 43 var url = w.location.href; |
| 44 return true; |
| 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 17 matching lines...) Expand all Loading... |
71 <a href="title2.html" id="samesite_tblank_link" target="_blank"> | 75 <a href="title2.html" id="samesite_tblank_link" target="_blank"> |
72 same-site target=_blank</a><br> | 76 same-site target=_blank</a><br> |
73 <a href="https://REPLACE_WITH_HOST_AND_PORT/files/title2.html" id="tblank_link" | 77 <a href="https://REPLACE_WITH_HOST_AND_PORT/files/title2.html" id="tblank_link" |
74 target="_blank">target=_blank</a><br> | 78 target="_blank">target=_blank</a><br> |
75 <a href="https://REPLACE_WITH_HOST_AND_PORT/files/title2.html" id="noref_link" | 79 <a href="https://REPLACE_WITH_HOST_AND_PORT/files/title2.html" id="noref_link" |
76 rel="noreferrer">rel=noreferrer</a><br> | 80 rel="noreferrer">rel=noreferrer</a><br> |
77 | 81 |
78 <iframe id="frame1" src="frame_tree/1-1.html"></iframe> | 82 <iframe id="frame1" src="frame_tree/1-1.html"></iframe> |
79 | 83 |
80 </html> | 84 </html> |
OLD | NEW |