summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/content-security-policy/navigate-to/support/spv-test-iframe1.sub.html
blob: 9e26c02be3110c19b7b6f69719fc5cd9cfcf2086 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<!DOCTYPE html>
<head>
  <script>
    window.onmessage = function(e) {
      if (e.data == "start_test") {
        document.getElementById('link').click();
        location.href = "{{location[server]}}/content-security-policy/navigate-to/support/spv-test-iframe3.sub.html";
      }
    }
    window.addEventListener('securitypolicyviolation', function(e) {
      top.postMessage({iframe: 'iframe1', violatedDirective: e.violatedDirective}, '*');
    });
  </script>
</head>

<body>
  <a href="{{location[server]}}/content-security-policy/navigate-to/support/delayed_frame.py" id="link" target="iframe2">dummy link</a>
  IFRAME 1
</body>