CSP not logging in Safari
liamfirth opened this issue · comments
Safari doesn't log content security policy violations because it doesn't emit the securitypolicyviolation on the window object, only on the document object. Rollbar JS only listens on the window object:
this.addListener("contentsecuritypolicy", this._window, "securitypolicyviolation", null, t, !1)
rollbar.js/src/browser/telemetry.js
Line 741 in a9c567c
Confirmed in MDN Browser compatibility data mdn/browser-compat-data#12334
You can also test this in a real-life scenario, events are logged when you attach them to document but not on window in Safari (works in Chrome). In the below example nothing is showing in the Rollbar dashboard but logged to console: