Title: Allow to handle CSP nonce for replay (rrweb) elements · Issue #10481 · getsentry/sentry-javascript · GitHub
Open Graph Title: Allow to handle CSP nonce for replay (rrweb) elements · Issue #10481 · getsentry/sentry-javascript
X Title: Allow to handle CSP nonce for replay (rrweb) elements · Issue #10481 · getsentry/sentry-javascript
Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using the latest SDK release https://github.com/...
Open Graph Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th...
X Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/10481
X: @github
Domain: github.com
IPv4 address: 140.82.113.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Allow to handle CSP nonce for replay (rrweb) elements","articleBody":"### Is there an existing issue for this?\n\n- [X] I have checked for existing issues [https://github.com/getsentry/sentry-javascript/issues](\u003chttps://github.com/getsentry/sentry-javascript/issues>)\n- [X] I have reviewed the documentation [https://docs.sentry.io/](\u003chttps://docs.sentry.io/>)\n- [X] I am using the latest SDK release [https://github.com/getsentry/sentry-javascript/releases](\u003chttps://github.com/getsentry/sentry-javascript/releases>)\n\n### How do you use Sentry?\n\nSentry Saas ([sentry.io](\u003chttp://sentry.io>))\n\n### Which SDK are you using?\n\nSentry Browser Loader\n\n### SDK Version\n\n7.99.0\n\n### Framework Version\n\n*No response*\n\n### Link to Sentry event\n\n*No response*\n\n### SDK Setup\n\n```javascript\nwindow.sentryOnLoad = function() {\n console.log(`register global Sentry use with site version ${window.site.base_version}`);\n window.Sentry.init({\n dsn: 'https://aba269c1f55349d89eadb788807dce2f@o413851.ingest.sentry.io/5302345',\n release: window.site.base_version,\n environment,\n attachStacktrace: true,\n // ignoreErrors: [...],\n ignoreTransactions: [\n 'https://r.lr-ingest.io'\n ],\n tracesSampleRate: 1.0,\n replaysSessionSampleRate: 0.1,\n replaysOnErrorSampleRate: 1.0,\n sendDefaultPii: true,\n stickySession: true,\n autoSessionTracking: true,\n networkDetailAllowUrls: [\"anchorbooting.com\", \"ab-dev.blue-labs.org\"],\n integrations: [\n // this doesn't work despite following the instructions for the Loader and key configuration (set to 7.x and perf/replay/debug enabled)\n // Sentry.replayIntegration({maskAllText: false, maskAllInputs: false, blockAllMedia: false,}),\n new Sentry.Integrations.HttpClient({failedRequestStatusCodes: [[400, 599]],}),\n ],\n\n beforeSend(event, hint) {\n setTimeout(whoops, 500);\n if (event && event.extra) {\n // holy hell.extra, why is event null?\n event.extra['form-datum'] = grobble_form_data();\n event.extra.username = window.username;\n }\n\n return event;\n },\n });\n\n window.Sentry.configureScope((scope) => {\n scope.setExtra(\"form-datum\", \"\");\n });\n}\n```\n\n### Steps to Reproduce\n\nAs soon as Sentry loads, telemetry starts being sent. This occurs:\n\nindex.js:2002 Refused to apply inline style because it violates the following Content Security Policy directive: \"style-src-attr 'self' 'strict-dynamic' [https://fonts.googleapis.com](\u003chttps://fonts.googleapis.com>) [https://use.fontawesome.com](\u003chttps://use.fontawesome.com>) [https://maps.googleapis.com](\u003chttps://maps.googleapis.com>) [https://sentry.io](\u003chttps://sentry.io>) [https://browser.sentry.io](\u003chttps://browser.sentry.io>) [https://browser.sentry-cdn.io](\u003chttps://browser.sentry-cdn.io>) [https://browser.sentry-cdn.com](\u003chttps://browser.sentry-cdn.com>) [https://js.sentry-cdn.com](\u003chttps://js.sentry-cdn.com>) [https://anchorbooting.com](\u003chttps://anchorbooting.com>) [https://www.anchorbooting.com](\u003chttps://www.anchorbooting.com>) [https://anchor-booting.appspot.com](\u003chttps://anchor-booting.appspot.com>) [https://anchor-booting.uc.r.appspot.com](\u003chttps://anchor-booting.uc.r.appspot.com>) [https://ab-dev.blue-labs.org](\u003chttps://ab-dev.blue-labs.org>) [https://cdn.lr-ingest.io](\u003chttps://cdn.lr-ingest.io>) [https://maps.googleapis.com](\u003chttps://maps.googleapis.com>)\".\u003cbr>(newline for clarity)\u003cbr>Either the 'unsafe-inline' keyword, a hash ('sha256-DV7YSgMWr/HY4EsViytQd0ytooqEFSst4W0YJHo8NkU='), or a nonce ('nonce-...') is required to enable inline execution. Note that hashes do not apply to event handlers, style attributes and javascript: navigations unless the 'unsafe-hashes' keyword is present.\n\n### Expected Result\n\nNo CSP errors :)\n\n### Actual Result\n\nThe CSP error :}","author":{"url":"https://github.com/FirefighterBlu3","@type":"Person","name":"FirefighterBlu3"},"datePublished":"2024-02-02T23:53:37Z","url":"https://github.com/getsentry/sentry-javascript/issues/10481"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:d3e50448-4689-70f8-7daa-e483c9e79b19 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B016:35875C:FF9F6D:14696F8:6B038B6C |
| html-safe-nonce | da4c69d7a5209b546adca33b472dc0545c20079aaab7e54706f969784baaa6b6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMDE2OjM1ODc1QzpGRjlGNkQ6MTQ2OTZGODo2QjAzOEI2QyIsInZpc2l0b3JfaWQiOiI0MjMyNDk4MDkzNjkxNzM0ODkyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 242cbfc4fcc276ca34ce7b2b07cad7b6d500441ce335c7b796aaebd4a28727df |
| hovercard-subject-tag | issue:2116007890 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/10481/issue_layout |
| twitter:image | https://opengraph.githubassets.com/bf7756a0080625b729921355a0c55c0612a5fe500b4d38ef08d2bb586c7fc1bb/getsentry/sentry-javascript/issues/10481 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/bf7756a0080625b729921355a0c55c0612a5fe500b4d38ef08d2bb586c7fc1bb/getsentry/sentry-javascript/issues/10481 |
| og:image:alt | Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | FirefighterBlu3 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3328572 |
| octolytics-dimension-repository_nwo | getsentry/sentry-javascript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3328572 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-javascript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width