COEPViolationReportBody: blockedURL property

The blockedURL read-only property of the COEPViolationReportBody interface returns the URL of the resource that was blocked from loading by an enforced COEP violation, or would be blocked if a report-only policy was enforced.

Value

An string containing a URL value.

Examples

Get the URL of the resource that triggered the report

In this example we create a new ReportingObserver to observe COEP violation reports, then log the value of blockedURL to the console.

js
const options = {
  types: ["coep"],
  buffered: true,
};

const observer = new ReportingObserver((reports, observer) => {
  const firstReport = reports[0];
  console.log(firstReport.type); // coep
  console.log(firstReport.body.blockedURL); // URL of the violating resource
}, options);

Specifications

No specification found

No specification data found for api.COEPViolationReportBody.blockedURL.
Check for problems with this page or contribute a missing spec_url to mdn/browser-compat-data. Also make sure the specification is included in w3c/browser-specs.

Browser compatibility