Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<html>
<head>
<title>connect-src-json-import-allowed</title>
<meta
http-equiv="Content-Security-Policy"
/>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
promise_test(t => new Promise((resolve, reject) => {
window.addEventListener("securitypolicyviolation", (err) => {
if (err.blockedURI.endsWith("/common/dummy.json")) {
reject("Should not raise securitypolicyviolation.");
}
});
import("/common/dummy.json", { with: { type: "json" } }).then(resolve, reject)
}), "import should be allowed");
</script>
</body>
</html>