diff options
Diffstat (limited to 'testing/web-platform/tests/html/browsers/history/the-location-interface/resources/replace-or-assign-call-on-iframe.html')
-rw-r--r-- | testing/web-platform/tests/html/browsers/history/the-location-interface/resources/replace-or-assign-call-on-iframe.html | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/resources/replace-or-assign-call-on-iframe.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/resources/replace-or-assign-call-on-iframe.html new file mode 100644 index 0000000000..bdad8334a5 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/resources/replace-or-assign-call-on-iframe.html @@ -0,0 +1,20 @@ +<!DOCTYPE HTML> +<html> + <head> + <title>Referer with location.replace and location.assign</title> + </head> + <body> + <iframe src="/resources/blank.html" hidden></iframe> + <script> + window.addEventListener('message', function (e) { + const referrer = e.data; + window.parent.postMessage(referrer); + }); + if (window.location.search === "?replace") { + document.querySelector("iframe").contentWindow.location.replace("iframe-contents.sub.html?replace"); + } else if (window.location.search === "?assign") { + document.querySelector("iframe").contentWindow.location.assign("iframe-contents.sub.html?assign"); + } + </script> + </body> +</html> |