blob: 011ea3ca978819d52b50e07785f133b9eb683cca (
plain)
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
|
<html>
<head>
<title>A top-level page with delayed cookie banner</title>
<script>
function clickOptOut() {
document.getElementById("result").textContent = "OptOut";
}
function clickOptIn() {
document.getElementById("result").textContent = "OptIn";
}
function generateBanner() {
let banner = document.createElement("div");
banner.id = "banner";
let buttonOptOut = document.createElement("button");
buttonOptOut.id = "OptOut";
buttonOptOut.onclick = () => {clickOptOut();};
let buttonOptIn = document.createElement("button");
buttonOptIn.id = "OptIn";
buttonOptIn.onclick = () => {clickOptIn();};
banner.appendChild(buttonOptOut);
banner.appendChild(buttonOptIn);
document.body.appendChild(banner);
}
window.onload = () => {
generateBanner();
};
</script>
<!-- This will cause DOMContentLoaded and load to be further apart which is
required for certain test cases. slowSubresource.sjs will delay the page load
event.-->
<link rel="stylesheet" href="slowSubresource.sjs">
</head>
<body>
<h1>This is the top-level page</h1>
<p id="result">NoClick</p>
</body>
</html>
|