-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Gives error without CSP style-src 'unsafe-inline' #2020
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
Comments
So just to make clear, you fixed this by adding |
Yes, that fixed it |
Since this isn't really a bug with the SDK I will close this issue. I hope people running into this will find the issue. Adding this to the docs is also not crystal clear since the solution heavily depends on your individual setup. |
@HazAT, I'll try to find the cause of this problem and when I get my head around it, I'll post the info in here :) |
I get the same error when I try to display the User Feedback Dialog! As a workaround, we're just going to load the CSS manually. |
A way to tell Sentry not to inline the CSS through a Sentry.showReportDialog({
eventId: 0,
loadStyles: false
}); |
@hugmanrique this would have to be implemented inside Sentry itself first, as the SDK just includes a script which then creates an iframe. https://github.com/getsentry/sentry |
This is a big issue for Chrome's push for manifest V3. Our chrome extension uses sentry. It's stitched throughout the code and we don't want to take it out. But with manifest V3 unsafe-inline is not an option. This really needs to be fixed and quickly since there is a deadline from Chrome. |
Adding unsafe-inline to a CSP is not safe. So I don't think this issue is resolved. Google Maps SDK grabs a nonce from the first |
Is there any update on this? I have a strict CSP and adding unsafe-line should not be the solution. I am now reluctant to turn on CSP reporting to sentry as this will create a lot of entries. |
For problems regarding CSP & Replay, please refer to newer issues (or create a new issue for it if no open issue matches it) - thank you! (for reference, I answered here: #6739 (comment)) |
I agree with #2020 (comment) this issue is not resolved, using I found there is similar issue to I couldn't work out a way to do the same for |
@leonk can you open a new issue with details on what you are doing? What is your config, which SDK, ... what functionality are you using/calling, etc? For just basic functionality without replay compression you shouldn't need to add any CSP rules. Or if you are using sveltekit, please post more details into #8925. |
Package + Version
@sentry/browser
Version:
Description
While using example setup for angular, I get error
Refused to apply inline style because it violates the following Content Security Policy directive: "style-src ...
. I tried adding nonce to the sentry script tag and also added sha256- from the error message but it still occured.My setup was easy, followed instructions on your page.
https://docs.sentry.io/platforms/javascript/angular/#angularjs-1x -> used the standalone part.
Also added urls following your CSP :
https://forum.sentry.io/t/required-content-security-policy/4484 -> updated the script-src value to add https://browser.sentry-cdn.com
Error traces back to:
sentryWrapped | @ | helpers.ts:84
that is:
return fn.apply(this, wrappedArguments);
The text was updated successfully, but these errors were encountered: