-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
39 lines (34 loc) · 1.21 KB
/
index.html
File metadata and controls
39 lines (34 loc) · 1.21 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Redirecting...</title>
<script>
// Get the full query string
const queryString = window.location.search;
// Parse the query parameters
const urlParams = new URLSearchParams(queryString);
// Extract the app name (first parameter)
const app = urlParams.get("app");
if (app) {
// Construct the path from all remaining parameters
const path = Array.from(urlParams.entries())
.filter(([key]) => key !== "app") // Exclude the app parameter
.map(([, value]) => value) // Get only the values
.join("/"); // Join them into a path
// Construct the deep link URL
const deepLinkURL = `${app}://${path}`;
// Redirect to the deep link
window.location.href = deepLinkURL;
} else {
// Show an error if the app parameter is missing
console.error("App name is missing!");
document.body.innerHTML = `<p>Error: Missing 'app' parameter in the URL.</p>`;
}
</script>
</head>
<body>
<p>Redirecting...</p>
</body>
</html>