-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathiframe.html
49 lines (45 loc) · 1.24 KB
/
iframe.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>webglo</title>
<style>
body {
margin: 0;
padding: 0;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}
iframe {
border: none;
width: 100%;
height: 100%;
}
.iframe-container {
position: relative;
width: 100%;
height: 100vh; /* Fullscreen */
overflow: hidden;
}
</style>
</head>
<body>
<div class="iframe-container">
<iframe id="dynamicIframe" src="" allowfullscreen></iframe>
</div>
<script>
// Get the URL parameter
const params = new URLSearchParams(window.location.search);
const iframeURL = params.get('url'); // Example: ?url=https://example.com
// Set the iframe's src attribute if a URL is passed
if (iframeURL) {
document.getElementById('dynamicIframe').src = iframeURL;
} else {
document.body.innerHTML = '<h1>No URL provided</h1>';
}
</script>
</body>
</html>