-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGMX-Mail-deref-decoder.html
52 lines (47 loc) · 1.64 KB
/
GMX-Mail-deref-decoder.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
<!DOCTYPE html>
<html>
<head>
<title>URL Decoder</title>
<script>
function decodeUrl(encodedUrl) {
const regexMail = /https:\/\/deref-mail\.com\/mail\/client\/([a-zA-Z0-9-_]{11})\/dereferrer\/\?redirectUrl=(.+)/;
const regexGMX = /https:\/\/deref-gmx\.net\/mail\/client\/([a-zA-Z0-9-_]{11})\/dereferrer\/\?redirectUrl=(.+)/;
const matchMail = encodedUrl.match(regexMail);
const matchGMX = encodedUrl.match(regexGMX);
if (matchMail && matchMail[2]) {
const strippedUrl = matchMail[2];
const decodedUrl = decodeURIComponent(strippedUrl);
return decodedUrl;
}
if (matchGMX && matchGMX[2]) {
const strippedUrl = matchGMX[2];
const decodedUrl = decodeURIComponent(strippedUrl);
return decodedUrl;
}
return null;
}
function decodeUrlAndDisplay() {
const encodedUrl = document.getElementById('encoded-url').value;
const decodedUrlContainer = document.getElementById('decoded-url');
if (encodedUrl) {
const decodedUrl = decodeUrl(encodedUrl);
if (decodedUrl) {
decodedUrlContainer.innerHTML = `<a href="${decodedUrl}" target="_blank">${decodedUrl}</a>`;
} else {
decodedUrlContainer.textContent = 'Invalid encoded URL';
}
} else {
decodedUrlContainer.textContent = 'No encoded URL provided';
}
}
</script>
</head>
<body>
<h1>URL Decoder</h1>
<p>Enter an encoded URL:</p>
<input type="text" id="encoded-url" placeholder="Encoded URL">
<button onclick="decodeUrlAndDisplay()">Decode URL</button>
<p>Decoded URL:</p>
<p id="decoded-url"></p>
</body>
</html>