Back to Content

SecurityPolicyViolationEvent: columnNumber property

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

latest651 B
Original Source

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

The columnNumber read-only property of the {{domxref("SecurityPolicyViolationEvent")}} interface is the column number in the document or worker script at which the Content Security Policy (CSP) violation occurred.

Value

A number representing the column number where the violation occurred.

Examples

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

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also

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