Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSP not logging in Safari #978

Closed
liamfirth opened this issue Dec 13, 2021 · 0 comments · Fixed by #1007
Closed

CSP not logging in Safari #978

liamfirth opened this issue Dec 13, 2021 · 0 comments · Fixed by #1007
Assignees

Comments

@liamfirth
Copy link

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)

this.addListener('contentsecuritypolicy', this._window, 'securitypolicyviolation', null, cspHandler, false);

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:

Screenshot 2021-12-13 at 10 33 23

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants