| Index: LayoutTests/http/tests/security/suborigins/resources/reach-into-iframe.php
|
| diff --git a/LayoutTests/http/tests/security/suborigins/resources/reach-into-iframe.php b/LayoutTests/http/tests/security/suborigins/resources/reach-into-iframe.php
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..7bb86868171cdbf4341f0df951f5868b140af0b8
|
| --- /dev/null
|
| +++ b/LayoutTests/http/tests/security/suborigins/resources/reach-into-iframe.php
|
| @@ -0,0 +1,28 @@
|
| +<?php
|
| +if ($_GET["suborigin"]) {
|
| + header("Content-Security-Policy: suborigin " . $_GET["suborigin"]);
|
| +}
|
| +?>
|
| +<!DOCTYPE html>
|
| +<html>
|
| +<script>
|
| +window.secret = '';
|
| +window.onmessage = function() {
|
| + var iframe = document.getElementById('iframe');
|
| + var secret;
|
| + try {
|
| + secret = iframe.contentWindow.secret;
|
| + } catch (e) {
|
| + secret = e.toString();
|
| + }
|
| + parent.postMessage(secret, '*');
|
| +};
|
| +</script>
|
| +<?php
|
| +if ($_GET["childsuborigin"]) {
|
| + echo "<iframe id=\"iframe\" src=\"post-to-parent.php?suborigin=" . $_GET["childsuborigin"] . "\"></iframe>";
|
| +} else {
|
| + echo "<iframe id=\"iframe\" src=\"post-to-parent.php\"></iframe>";
|
| +}
|
| +?>
|
| +</html>
|
|
|