summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/cross-origin-embedder-policy/resources/navigate-require-corp-same-site.sub.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/html/cross-origin-embedder-policy/resources/navigate-require-corp-same-site.sub.html')
-rw-r--r--testing/web-platform/tests/html/cross-origin-embedder-policy/resources/navigate-require-corp-same-site.sub.html29
1 files changed, 29 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/cross-origin-embedder-policy/resources/navigate-require-corp-same-site.sub.html b/testing/web-platform/tests/html/cross-origin-embedder-policy/resources/navigate-require-corp-same-site.sub.html
new file mode 100644
index 0000000000..910317d29b
--- /dev/null
+++ b/testing/web-platform/tests/html/cross-origin-embedder-policy/resources/navigate-require-corp-same-site.sub.html
@@ -0,0 +1,29 @@
+<!doctype html>
+<script>
+ const current = new URL(window.location.href);
+ const token = current.searchParams.get("token");
+ const navigateTo = current.searchParams.get("to");
+ const channelName = current.searchParams.get("channelName");
+ const clearOpener = current.searchParams.get("clearOpener");
+
+ if (clearOpener) {
+ window.opener = null;
+ }
+
+ current.search = "";
+ if (navigateTo) {
+ let next = new URL(navigateTo, current);
+ window.addEventListener("load", () => {
+ window.location = next.href;
+ });
+ }
+
+ if (channelName) {
+ let bc = new BroadcastChannel(channelName);
+ bc.postMessage("loaded");
+ }
+
+ if (parent !== window && token) {
+ parent.postMessage(token, "*");
+ }
+</script>