-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
93 lines (86 loc) · 3.31 KB
/
index.html
File metadata and controls
93 lines (86 loc) · 3.31 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<title>Redirecting...</title>
<style>
.container {
font-family: -apple-system, BlinkMacSystemFont, Inter, 'Inter UI', 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
width: 640px;
margin: auto;
max-width: 80%;
line-height: 1.6em;
}
code {
background-color: lightgray;
padding: 2px;
border-radius: 2px;
font-family: 'SF Mono', Menlo, monospace;
font-size: 12px;
}
h1 {
opacity: 1;
transition: all 1s;
}
.hidden {
display: none;
}
hr {
border-style: solid;
border-color: gray;
}
</style>
</head>
<body>
<div class="container">
<div class="hidden" id="happened">
<h1>✅ Redirect happened</h1>
<hr>
</div>
<h2 id="redirector">About this page</h1>
<p>A simple URL redirector for easy app deep linking when link embeds don't allow non-HTTP(S) links
(like
Notion and Google Docs). Use at your own risk. </p>
<p>This is hosted on <a href="https://r.mhmd.us">https://r.mhmd.us</a> </p>
<h3 id="how-to-use">How to use</h3>
<ul>
<li>Append any link to this path: <code>https://r.mhmd.us/?redirect=YOUR LINK HERE</code>. </li>
<li>After 5 seconds, the tab will automatically close. </li>
</ul>
<h3 id="use-cases">Use cases</h3>
<p>Redirect app scheme specific URLs from websites and apps that prohibit these. Notion and Google Docs do
this, I'm sure others out there do this too. </p>
<p>An example would be create a new task in Things.app:</p>
<ol>
<li>Append the app scheme: <code>?redirect=things:///</code></li>
<li>Add the task as described within the Things docs:
<code>?redirect=things:///add?title=get%20oat%20milk</code>.</li>
</ol>
<p>You can learn more about Things' URL schemes here: <a
href="https://culturedcode.com/things/support/articles/2803573/">https://culturedcode.com/things/support/articles/2803573/</a>
</p>
<hr>
<p><a href="https://github.com/usmanity/redirector">Github Repo</a></p>
</div>
<script>
function showRedirectHappening() {
const el = document.getElementById('happened');
el.classList.remove('hidden');
}
const urlParams = new URLSearchParams(window.location.search);
const redirect = urlParams.get('redirect') || urlParams.get('r');
if (redirect) {
window.location = redirect;
setTimeout(() => {
window.close();
}, 5000);
showRedirectHappening();
} else {
document.title = "Did not redirect"
}
</script>
</body>
</html>