blob: 0f0988b508915b05310643ee62f579ae65ddcd2a (
plain) (
blame)
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
|
<!DOCTYPE html>
<html lang="en">
<head>
<title>document.write test</title>
<script>
window.onload = function() {
const success = document.body.innerHTML == document.querySelector("style").textContent;
while (document.body.childNodes[0])
document.body.childNodes[0].remove();
document.body.innerHTML = success ? "Success" : "Fail";
}
let checkpointCounter = 0;
function checkpoint(n) {
if (++checkpointCounter != n)
throw new TypeError(`Checkpoint failed: expected ${n} but got ${checkpointCounter}`);
}
</script>
<style><script>
document.write(`<script>
document.write("a");
`);
document.write(`
document.write("<script></scr" + "ipt>x");
`);
document.write(`
document.write("t");
</scr` + "ipt>");
</script><script>
document.write("a");
document.write("<script></scr" + "ipt>x");
document.write("t");
</script>a<script></script>xt
</style>
</head>
<body><script>
document.write(`<script>
document.write("a");
`);
document.write(`
document.write("<script></scr" + "ipt>x");
`);
document.write(`
document.write("t");
</scr` + "ipt>");
</script></body>
</html>
|