-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
I'm experimenting with something like this:
document.addEventListener( 'securitypolicyviolation', ( e ) =>
{
if( !e.sourceFile.startsWith( location.origin ) )
{
return;
}
const error = new Error( `CSP Error ${e.violatedDirective}` );
error.name = 'SecurityPolicyViolationError';
Bugsnag.notify( error, {
severity: 'info',
metadata:
{
originalPolicy: e.originalPolicy,
sourceFile: e.sourceFile,
blockedURI: e.blockedURI
}
} );
} );This could be wrapped into a nicely formatted plugin.
Metadata
Metadata
Assignees
Labels
No labels