diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
commit | 43a97878ce14b72f0981164f87f2e35e14151312 (patch) | |
tree | 620249daf56c0258faa40cbdcf9cfba06de2a846 /dom/tests/mochitest/dom-level0/child_ip_address.html | |
parent | Initial commit. (diff) | |
download | firefox-43a97878ce14b72f0981164f87f2e35e14151312.tar.xz firefox-43a97878ce14b72f0981164f87f2e35e14151312.zip |
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/tests/mochitest/dom-level0/child_ip_address.html')
-rw-r--r-- | dom/tests/mochitest/dom-level0/child_ip_address.html | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/dom/tests/mochitest/dom-level0/child_ip_address.html b/dom/tests/mochitest/dom-level0/child_ip_address.html new file mode 100644 index 0000000000..24c1f0ba30 --- /dev/null +++ b/dom/tests/mochitest/dom-level0/child_ip_address.html @@ -0,0 +1,39 @@ +<!DOCTYPE html> +<html> +<head> + <title>Child window at 127.0.0.1</title> + <script type="application/javascript"> +function run() +{ + var target = document.getElementById("location"); + target.textContent = location.hostname + ":" + (location.port || 80); + + var message = "child-response"; + + var domain = document.domain; + if (domain !== "127.0.0.1") + message += " wrong-initial-domain(" + domain + ")"; + + try + { + document.domain = "0.0.1"; + domain = document.domain; + message += " ip-address-shortened-to(" + domain + ")"; + } + catch (e) + { + domain = document.domain; + if (domain !== "127.0.0.1") + message += " ip-address-mutated-on-throw(" + domain + ")"; + } + + window.parent.postMessage(message, "http://mochi.test:8888"); +} + +window.addEventListener("load", run); + </script> +</head> +<body> +<h1 id="location">Somewhere!</h1> +</body> +</html> |