Back to Content

SecurityPolicyViolationEvent: blockedURI property

files/en-us/web/api/securitypolicyviolationevent/blockeduri/index.md

latest632 B
Original Source

{{APIRef("Reporting API")}}{{AvailableInWorkers}}

The blockedURI read-only property of the {{domxref("SecurityPolicyViolationEvent")}} interface is a string representing the URI of the resource that was blocked because it violates a Content Security Policy (CSP).

Value

A string representing the URI of the blocked resource.

Examples

js
document.addEventListener("securitypolicyviolation", (e) => {
  console.log(e.blockedURI);
});

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also

  • {{domxref("CSPViolationReportBody.blockedURL")}}