Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /content-security-policy/navigate-to/anchor-navigation-always-allowed.html - WPT Dashboard Interop Dashboard
<!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>