forked from browserhtml/browserhtml
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnet_error.html
More file actions
34 lines (25 loc) · 913 Bytes
/
net_error.html
File metadata and controls
34 lines (25 loc) · 913 Bytes
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
<!DOCTYPE html>
<html>
<!--
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-->
<!--
This is a netError placeholder. See issue #362
-->
<head>
<meta charset='utf-8'>
</head>
<body>
<script defer='defer'>
// <script src="…"> doesn't work because of about:netError redirection.
// We have to use an inline script or use a app:// URL.
// Small hack to get the URL object to parse the URI correctly.
var url = new URL(document.documentURI.replace('about:', 'http://'));
var error = textContent = url.searchParams.get('e');
var description = textContent = url.searchParams.get('d');
document.body.textContent = `${error}: ${description}`;
</script>
</body>
</html>