-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add securitypolicyviolation
plugin
#136
Comments
Looks great! Are you interested in making a PR for this? |
This might require more work as bugsnag groups these errors together inconsistently, perhaps it needs to create separate error names for each directive. And as always with CSP there's some spam caused by browser extensions. |
For what it's worth, we can simplify the code to just pass in a structured object rather than an Bugsnag.notify(
{
name: 'SecurityPolicyViolationError',
message: `CSP Error ${e.violatedDirective}`,
},
{
severity: 'info',
metadata: {
originalPolicy: e.originalPolicy,
sourceFile: e.sourceFile,
blockedURI: e.blockedURI,
},
},
); I'm not quite sure why Bugsnag is grouping them differently. I think it uses the error class and top stack frame (ref) so it should be the same.
Yeah, I'm finding CSP reports mostly useless because of browser extensions. |
The stacktrace being the same in this callback would cause the groupings yeah. But that's maybe not ideal for different classes of violations. |
I'm experimenting with something like this:
This could be wrapped into a nicely formatted plugin.
The text was updated successfully, but these errors were encountered: