1
0
Fork 0
firefox/testing/web-platform/tests/content-security-policy/connect-src/connect-src-json-import-blocked.sub.html
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

31 lines
837 B
HTML

<!DOCTYPE html>
<html>
<head>
<title>connect-src-json-import-blocked</title>
<meta
http-equiv="Content-Security-Policy"
content="connect-src 'none'; script-src 'self' 'unsafe-inline';"
/>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
promise_test((t) => {
let check_spv = new Promise((resolve) => {
window.addEventListener("securitypolicyviolation", (e) => {
if (e.blockedURI.endsWith("dummy.json")) {
resolve();
}
});
});
return Promise.all([
promise_rejects_js(t, TypeError, import("/common/dummy.json", { with: { type: "json" } })),
check_spv,
]);
});
</script>
</body>
</html>