COEPViolationReportBody: disposition property
The disposition
read-only property of the COEPViolationReportBody
dictionary indicates whether the 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.
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
No specification found
No specification data found for api.COEPViolationReportBody.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.