forked from christhompson/lna-testing
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathframe-script.js
More file actions
29 lines (25 loc) · 1.28 KB
/
frame-script.js
File metadata and controls
29 lines (25 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
// Used for frame.html subframe navigation.
const subframeFormNoAllowlist = document.getElementById("subframe-form-not-allowlisted");
const subframeInputBoxNoAllowlist = document.getElementById("subframe-input-box-not-allowlisted");
const subframeIFrameNoAllowlist = document.getElementById("subframe-not-allowlisted");
subframeFormNoAllowlist.addEventListener("submit", (event) => {
event.preventDefault();
if (!subframeInputBoxNoAllowlist.validity.valid) {
console.log("Input URL not valid");
return;
}
console.log("Navigating subframe to " + subframeInputBoxNoAllowlist.value);
subframeIFrameNoAllowlist.src = subframeInputBoxNoAllowlist.value;
});
const subframeFormAllowlist = document.getElementById("subframe-form-allowlisted");
const subframeInputBoxAllowlist = document.getElementById("subframe-input-box-allowlisted");
const subframeIFrameAllowlist = document.getElementById("subframe-allowlisted");
subframeFormAllowlist.addEventListener("submit", (event) => {
event.preventDefault();
if (!subframeInputBoxAllowlist.validity.valid) {
console.log("Input URL not valid");
return;
}
console.log("Navigating subframe to " + subframeInputBoxAllowlist.value);
subframeIFrameAllowlist.src = subframeInputBoxAllowlist.value;
});