-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-harness.html
More file actions
73 lines (61 loc) · 1.75 KB
/
Copy pathtest-harness.html
File metadata and controls
73 lines (61 loc) · 1.75 KB
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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Input Sanitizer Test Harness</title>
<style>
:root {
color-scheme: light dark;
}
body {
font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
margin: 24px;
}
h1 {
margin: 0 0 8px 0;
}
button {
padding: 8px 12px;
border-radius: 8px;
border: 1px solid #ccc;
cursor: pointer;
}
.results {
margin-top: 16px;
display: grid;
gap: 8px;
}
.case {
padding: 10px;
border-radius: 10px;
border: 1px solid #ddd;
}
.pass {
border-color: #10b981;
background: rgba(16, 185, 129, 0.08);
}
.fail {
border-color: #ef4444;
background: rgba(239, 68, 68, 0.08);
}
pre {
white-space: pre-wrap;
background: rgba(0, 0, 0, 0.05);
padding: 8px;
border-radius: 8px;
}
</style>
</head>
<body>
<h1>Input Sanitizer Test Harness</h1>
<p>This runs a small set of sanitizer tests in the browser (DOMPurify required).</p>
<button id="runTests">Run tests</button>
<div id="summary"></div>
<div id="results" class="results"></div>
<script src="https://cdn.jsdelivr.net/npm/dompurify@3.0.9/dist/purify.min.js"
integrity="sha384-3HPB1XT51W3gGRxAmZ+qbZwRpRlFQL632y8x+adAqCr4Wp3TaWwCLSTAJJKbyWEK"
crossorigin="anonymous"></script>
<script src="test-harness.js"></script>
</body>
</html>