Spaces:
Running
Running
Create web.js
Browse files
web.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export function loadURL(url) {
|
| 2 |
+
const iframe = document.getElementById("browser");
|
| 3 |
+
|
| 4 |
+
// Basic safety normalization
|
| 5 |
+
if (!url.startsWith("http")) {
|
| 6 |
+
url = "https://" + url;
|
| 7 |
+
}
|
| 8 |
+
|
| 9 |
+
iframe.src = url;
|
| 10 |
+
}
|