diff options
Diffstat (limited to 'testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/resources/multiple-opener.html')
-rw-r--r-- | testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/resources/multiple-opener.html | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/resources/multiple-opener.html b/testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/resources/multiple-opener.html new file mode 100644 index 0000000000..2e63b9f4c6 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/resources/multiple-opener.html @@ -0,0 +1,32 @@ +<!doctype html> +<html> +<script src="/common/PrefixedLocalStorage.js"></script> +<body onload="openNested()"> +<script> +var prefixedLocalStorage = new PrefixedLocalStorageResource({ + close_on_cleanup: true +}); +function openNested () { + // Listen for message from opened context and pass through to this + // context's opener + window.addEventListener('message', (e) => { + if (window.opener) { + window.opener.postMessage({ + aux2: e.data, // From multipleOpenee + aux1: { // This context + name : window.name, + openerName : window.opener.name, + isTop : window.top === window + } + }, '*'); + } + }); + var a = document.createElement('a'); + a.target = 'multipleOpenee'; + a.href = prefixedLocalStorage.url('message-window-opener.html'); + document.body.appendChild(a); + a.click(); +} +</script> +</body> +</html> |