Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!doctype html>
<meta http-equiv="content-security-policy" content="img-src 'self'">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
async_test(t => {
const i = document.createElement("img");
const url = window.origin + "/common/" + encodeURIComponent(target);
window.addEventListener('securitypolicyviolation', t.step_func_done((e) => {
assert_equals(e.blockedURI, url);
i.onload = t.step_func(() => {
assert_unreached("Img should be blocked.");
i.src = url;
}, "The blocked URI in the security policy violation event should be the original URI before redirects.");