forked from parcoillegacy/nativelite
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathviewer.html
More file actions
62 lines (58 loc) · 1.28 KB
/
viewer.html
File metadata and controls
62 lines (58 loc) · 1.28 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
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<title>Mini Proxy Web</title>
<style>
body {
font-family: sans-serif;
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
height: 100vh;
}
form {
display: flex;
padding: 10px;
background-color: #f2f2f2;
}
input[type="text"] {
flex: 1;
padding: 8px;
font-size: 16px;
}
button {
padding: 8px 16px;
font-size: 16px;
cursor: pointer;
}
iframe {
flex: 1;
border: none;
width: 100%;
}
</style>
</head>
<body>
<form id="proxyForm">
<input type="text" id="urlInput" placeholder="Introduce una URL (ej. https://example.com)">
<button type="submit">Cargar</button>
</form>
<iframe id="viewer" src=""></iframe>
<script>
const form = document.getElementById('proxyForm');
const input = document.getElementById('urlInput');
const iframe = document.getElementById('viewer');
form.addEventListener('submit', function(e) {
e.preventDefault();
let url = input.value.trim();
// Asegura que tenga protocolo
if (!/^https?:\/\//i.test(url)) {
url = 'https://' + url;
}
iframe.src = url;
});
</script>
</body>
</html>