summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/content-security-policy/unsafe-hashes/support/child_window_location_navigate.sub.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/content-security-policy/unsafe-hashes/support/child_window_location_navigate.sub.html')
-rw-r--r--testing/web-platform/tests/content-security-policy/unsafe-hashes/support/child_window_location_navigate.sub.html21
1 files changed, 21 insertions, 0 deletions
diff --git a/testing/web-platform/tests/content-security-policy/unsafe-hashes/support/child_window_location_navigate.sub.html b/testing/web-platform/tests/content-security-policy/unsafe-hashes/support/child_window_location_navigate.sub.html
new file mode 100644
index 0000000000..3068822f37
--- /dev/null
+++ b/testing/web-platform/tests/content-security-policy/unsafe-hashes/support/child_window_location_navigate.sub.html
@@ -0,0 +1,21 @@
+<!DOCTYPE HTML>
+<html>
+
+<head>
+ <meta http-equiv="Content-Security-Policy" content="{{GET[csp]}}">
+</head>
+
+<body>
+
+ <span id="escape">{{GET[url]}}</span>
+
+ <script nonce='abc'>
+ window.addEventListener('securitypolicyviolation', function(e) {
+ opener.postMessage('fail', '*');
+ });
+
+ window.location.href = document.getElementById("escape").textContent;
+ </script>
+</body>
+
+</html>