-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherror.html
More file actions
47 lines (43 loc) · 1.44 KB
/
error.html
File metadata and controls
47 lines (43 loc) · 1.44 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<title>Error!</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- import the webpage's stylesheet -->
<style>
@import url("./css/clean.css");
</style>
</head>
<body>
<div id="notinstalled">
<h2>This site requires a <a href="https://support.apple.com/en-au/guide/shortcuts/apdf22b0444c/2.2/ios/12.0">Shortcut</a> called</h2>
<h1 class="name"></h1>
<a id="link" class="button" >Get Shortcut</a>
</div>
<div id="error">
<h1>
Oops!
</h1>
<p>There was an error while running "<span class="name"></span>"</p>
<code class="error"></code>
</div>
<script>
var params = new URLSearchParams(window.location.search);
var sname = params.get("name");
var link = params.get("uri");
var error = params.get("errorMessage");
document.querySelector("#link").href=link;
document.querySelectorAll(".name").forEach(n=>n.textContent=sname);
document.querySelectorAll(".error").forEach(n=>n.textContent=error);
if (error === null) {
window.location="#notinstalled";
} else if (error.match(/not.*?find.*?shortcut/i)) {
window.location="#notinstalled";
} else {
window.location="#error";
};
</script>
</body>
</html>