summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/content-security-policy/navigate-to/anchor-navigation-always-allowed.html
blob: 658897fb1becdc487fccdd6b52607ae3550bba78 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<!DOCTYPE html>

<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>

<body>

<a name="anchor"></a>

<script>
  var t = async_test("Test that anchor navigation is allowed regardless of the `navigate-to` directive");

  window.addEventListener('securitypolicyviolation', t.unreached_func("Should not have triggered any violation"));

  try {
    window.location.hash = "anchor";
    t.done();
  } catch(ex) {}
</script>

</body>