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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
<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 clickSameSiteNoRefTargetedLink() {
return simulateClick(
document.getElementById("samesite_noref_and_targeted_link"));
}
function clickSameSiteTargetedLink() {
return simulateClick(document.getElementById("samesite_targeted_link"));
}
function clickSameSiteTargetBlankLink() {
return simulateClick(document.getElementById("samesite_tblank_link"));
}
function clickTargetBlankLink() {
return simulateClick(document.getElementById("tblank_link"));
}
function clickNoRefLink() {
return simulateClick(document.getElementById("noref_link"));
}
function testScriptAccessToWindow() {
// Grab a reference to the existing foo window and access its location.
var w = window.open("", "foo");
var url = w.location.href;
return url != undefined;
}
function testCloseWindow() {
// Grab a reference to the existing foo window and close it.
var w = window.open("", "foo");
w.close();
return true;
}
// Listen to incoming messages and reply to them.
var receivedMessages = 0;
window.addEventListener("message", messageReceived, false);
function messageReceived(event) {
receivedMessages++;
event.source.postMessage(event.data, "*");
}
</script>
</head>
<a href="https://REPLACE_WITH_HOST_AND_PORT/files/title2.html"
id="noref_and_tblank_link" rel="noreferrer" target="_blank">
rel=noreferrer and target=_blank</a><br>
<a href="title2.html" id="samesite_noref_and_targeted_link"
rel="noreferrer" target="foo">
same-site rel=noreferrer and target=foo</a><br>
<a href="navigate_opener.html" id="samesite_targeted_link" target="foo">
same-site target=foo</a><br>
<a href="title2.html" id="samesite_tblank_link" target="_blank">
same-site target=_blank</a><br>
<a href="https://REPLACE_WITH_HOST_AND_PORT/files/title2.html" id="tblank_link"
target="_blank">target=_blank</a><br>
<a href="https://REPLACE_WITH_HOST_AND_PORT/files/title2.html" id="noref_link"
rel="noreferrer">rel=noreferrer</a><br>
<iframe id="frame1" src="frame_tree/1-1.html"></iframe>
</html>
|