Repository navigation
docs(js): Document Trusted Types policies of the SDK and Loader Script - #20968
Draft
sentry-junior[bot] wants to merge 1 commit into
Draft
sentry-junior[bot] wants to merge 1 commit into
sentry-junior[bot] wants to merge 1 commit into
Conversation
Co-Authored-By: Martin Sonnberger <26038247+msonnb@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DESCRIBE YOUR PR
Documents Trusted Types support in the JavaScript SDK and the Loader Script: which policies Sentry creates (
sentry-sdk,sentry-loader), what they're used for, how to allow them in thetrusted-typesCSP directive, and what happens with and withoutrequire-trusted-types-for 'script'.best-practices/trusted-types.mdx(Special Use Cases), with the policy table, a copy-pasteable CSP header and<meta>example,'allow-duplicates'for pages with several SDK versions, fallback behavior, and known limitations.Don't merge until these ship:
sentry-sdkpolicy: Replay compression worker,lazyLoadIntegration,showReportDialogscript)sentry-loaderpolicy in the Loader Script)getTrustedScriptURLoption for the canvas worker)TODOs / open questions
<AvailableSince version="TODO" />with an MDX comment; set it once feat(browser): Support Trusted Types when loading scripts and workers sentry-javascript#26764 is released (latest release today is 11.17.0).sentry-loaderpolicy ships with the Sentry backend, not the SDK. Should the page note when it's live on sentry.io / which self-hosted version has it?getTrustedScriptURLintoreplayCanvasIntegration(and say whether it then usessentry-sdk, as the rrweb PR suggests).error-page-embed.jsstill usesinnerHTML, so the dialog itself is blocked even though its script loads. The page lists that as a limitation. Remove it if that gets fixed before release.workerUrl: the page says a plain-string custom worker URL is blocked and Replay falls back to uncompressed recordings. Is passing aTrustedScriptURLfrom the app's own policy a supported path we should document?ReplayWorkerURLis typedstring | URLtoday.feedbackAsyncIntegration(it loads throughlazyLoadIntegration). The PRs don't say whether the widget's own DOM code works underrequire-trusted-types-for 'script'.IS YOUR CHANGE URGENT?
PRE-MERGE CHECKLIST
via @msonnb.
--
View Session [Sentry]