-
Notifications
You must be signed in to change notification settings - Fork 7
/
index.html
62 lines (58 loc) · 2.14 KB
/
index.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
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
<!DOCTYPE html>
<html>
<head>
<title>Show js error</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<meta http-equiv="Content-Security-Policy" content="default-src 'self' 'unsafe-inline'" />
<script src="../dist/show-js-error.js"></script>
</head>
<body>
<button onclick="jsError()">JavaScript error</button>
<button onclick="unhandledPromise()">Unhandled promise rejection</button>
<button onclick="cspError()">CSP error</button>
<br/><br/>
<button onclick="showJSError.show({ message: 'Hello error!', stack: 'No stack' })">.show({ message: 'Hello error!')</button>
<button onclick="showJSError.show()">.show()</button>
<button onclick="showJSError.hide()">.hide()</button>
<button onclick="showJSError.toggleView()">.toggleView()</button>
<button onclick="showJSError.clear()">.clear()</button>
<button onclick="showJSError.destruct()">.destruct()</button>
<script src="a.js"></script>
<script src="b.js"></script>
<script src="c.js"></script>
<script>
function d() {
var a = root;
}
a();
</script>
<script>
showJSError.setSettings({
reportUrl: 'https://github.com/hcodes/show-js-error/issues/new?title={title}&body={body}'
});
function jsError() {
a();
}
function unhandledPromise() {
new Promise(function(resolve, reject) {
var a = b + c;
});
}
function cspError() {
var script = document.createElement('script');
script.src = 'https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js';
document.body.appendChild(script);
}
</script>
<script>
var a = b;
</script>
<script>
var a = c;
</script>
<script>
var a = root;
</script>
</body>
</html>