summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/browsers/sandboxing/resources/sandbox-inherited-from-initiator-response-helper.html
blob: 29c7f12441f7473d8f7dc5adb9046c764daa7745 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<script>
  const iframe_1_script = encodeURI(`
    <script>
      try {
        document.domain = document.domain;
        parent.postMessage("not sandboxed", "*");
      } catch (exception) {
        parent.postMessage("sandboxed", "*");
      }
    </scr`+`ipt>
  `);

  const iframe_1 = parent.document.querySelector("#iframe_1");
  iframe_1.src = `data:text/html,${iframe_1_script}`;
</script>