forked from servo/servo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbadcert.html
28 lines (28 loc) · 876 Bytes
/
badcert.html
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
<html>
<head>
<title>Certificate error</title>
</head>
<body>
<p>${reason}</p>
<button id="leave" onclick="history.back()">Go back (recommended)</button>
<button id="allow">Allow certificate temporarily</button>
<div style="word-break: break-all; font-family: monospace" id="bytes">${bytes}</div>
<script>
let bytes = document.getElementById('bytes').textContent;
let button = document.getElementById('allow');
let exitButton = document.getElementById('leave');
if (bytes.length) {
button.onclick = function() {
let xhr = new XMLHttpRequest();
xhr.open('POST', 'chrome:allowcert');
xhr.onloadend = function() {
location.reload(true);
};
xhr.send("${secret}&${bytes}");
};
} else {
button.style.display = "none";
}
</script>
</body>
</html>