forked from joaomgcd/Tasker-Permissions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
56 lines (53 loc) · 1.87 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
<!DOCTYPE html>
<html>
<head>
<title>Tasker Permissions</title>
<meta charset="utf-8"/>
<meta name="description" content="Tasker Permissions">
<meta name="viewport" content="width=device-width, height=device-height,initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<script>
const isType = (value, name) => {
if (value === null || value === undefined || !name) return false;
return value.constructor.name == name;
}
const isString = (value) => isType(value, "String");
const replaceAll = (string, replaceThis, withThis) => {
if (!isString(string)) return string;
return string.split(replaceThis).join(withThis);
}
const errorHandler = (e) => {
console.error("Caught unexpected error", e);
var message = e;
if(!isString(e)){
message = e.message;
if(!message && e.getMessage){
message = e.getMessage();
}
}
message = `Unexpected Error: ${message}. Please contact developer about it.`;
if(e.filename){
message = `${message} in file ${e.filename}`;
}
if(e.lineno){
message = `${message} at line ${e.lineno}`;
}
if(e.stack){
message = `${message}\n\nTrace:\n${e.stack}`;
}
alert(message);
}
window.onerror = errorHandler;
window.onunhandledrejection = errorPromise=>errorPromise.promise.catch(errorHandler);
</script>
<script type="module">
import {App} from './app/app.js';
const app = new App();
const body = document.querySelector("body");
body.innerHTML = "";
app.render().then(render=>body.appendChild(render));
</script>
</head>
<body class="panel">
Loading ADB Permissions...
</body>
</html>