Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 1 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /content-security-policy/tentative/require-sri-for/script-blocked-meta.https.html - WPT Dashboard Interop Dashboard
<!doctype html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<meta http-equiv="Content-Security-Policy" content="require-sri-for 'script'">
<script src="/content-security-policy/resources/ran.js"></script>
<script>
promise_test(async t => {
const watcher = new EventWatcher(t, document, ['securitypolicyviolation']);
const e = await watcher.wait_for('securitypolicyviolation');
assert_equals(e.blockedURI, `${location.origin}/content-security-policy/resources/ran.js`);
assert_true(typeof(window.ran) == "undefined", "Script did not ran");
}, "Test that meta require-sri-for blocks scripts with no SRI");
</script>