COEPViolationReportBody: disposition property

The disposition read-only property of the COEPViolationReportBody dictionary indicates whether this policy violation was enforced, blocking loading of the associated resource, or just reported.

Value

A string that can have one of the following values:

"enforce"

The violation caused loading of the embedded resource to be blocked. This is set for violations of policies set with Cross-Origin-Embedder-Policy.

"reporting"

The violation was reported without blocking the resource from loading. This is set for violations of policies set with Cross-Origin-Embedder-Policy-Report-Only.

Examples

Get the disposition of a report

In this example we create a new ReportingObserver to observe COEP violation reports, then log the value of disposition 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.disposition);
}, options);

Specifications

Specification
HTML
# embedder-policy-checks
HTML
# coep

Browser compatibility