summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/content-security-policy/navigate-to/support/link_click_navigation.sub.html
blob: 2434271211f36a456ea2bf61e717e4233a660bba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<!DOCTYPE html>
<head>
  <script src="/resources/testharness.js"></script>
  <script src="/resources/testharnessreport.js"></script>
</head>

<body>
<a href="{{GET[target]}}" id="link">dummy link</a>
<script>
  window.addEventListener('securitypolicyviolation', function(e) {
    top.postMessage({result: 'fail', violatedDirective: e.violatedDirective}, '*');
  });

  document.getElementById('link').click();
</script>
</body>