COOPViolationReportBody: disposition property

The disposition read-only property of the COOPViolationReportBody dictionary indicates whether the report is for an enforced or report-only policy violation.

Policy violations are enforced if the policy was set with Cross-Origin-Opener-Policy, and report-only if set with Cross-Origin-Embedder-Policy-Report-Only.

Value

A string that can have one of the following values:

"enforce"

The report is for policy violation that was enforced.

"reporting"

The report is for policy violation that was report-only.

Examples

Get the disposition of a report

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

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

const observer = new ReportingObserver((reports, observer) => {
  const firstReport = reports[0];
  console.log(firstReport.type); // coop
  console.log(firstReport.body.disposition);
}, options);

Specifications

No specification found

No specification data found for api.COOPViolationReportBody.disposition.
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