aboutsummaryrefslogtreecommitdiffstats
path: root/resources/badcert.html
blob: 4933f5af0cb412656320c911e86d4b95509eb8a6 (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
<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>