Repository navigation
🐛 Accept application-created TrustedScriptURL worker URLs - #5233
Draft
theinterned wants to merge 1 commit into
Draft
theinterned wants to merge 1 commit into
theinterned wants to merge 1 commit into
Conversation
Validate workerUrl using the native Trusted Types brand check and preserve its identity through configuration and Worker construction. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
I have read the CLA Document and I hereby sign the CLA You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
There was a problem hiding this comment.
More details
Application-created TrustedScriptURL values are preserved through configuration and Worker construction, while arbitrary stringifiable objects remain rejected. Static review identified no actionable defect.
🤖 Bits Code Review · Commit 9e429e3
theinterned
marked this pull request as draft
November 3, 2026 22:55
This branch has not been 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.
Motivation
Applications that enforce Trusted Types and own their worker policy cannot pass a genuine
TrustedScriptURLthroughworkerUrl: configuration currently rejects it as a non-string. This also affects intake compression with Session Replay disabled.Changes
string | TrustedScriptURL, using the nativetrustedTypes.isScriptURL()brand check rather than accepting arbitrary stringifiable objects.getInitConfiguration(), and the Worker constructor. Keep existing string and absent-value behavior.require-trusted-types-for 'script', with Session Replay sampling set to zero.This is limited to application-created worker URLs. It creates no SDK policy or worker-factory API and does not address lazy chunks or the asynchronous CDN snippet. The implementation and tests were AI-assisted.
Test instructions
yarn test:unit \ --spec packages/browser-rum-core/src/domain/configuration/configuration.spec.ts \ --spec packages/browser-rum-core/src/boot/rumPublicApi.spec.ts \ --spec packages/browser-rum/src/domain/deflate/deflateWorker.spec.ts yarn test:e2e transport.scenario.ts -g 'TrustedScriptURL worker'Locally: 227 unit tests passed; the Chromium scenario passed against freshly built production bundles. Type checking and focused lint/format checks passed. The local browser runner used installed Chrome, allowed static serving from a hidden checkout directory, and omitted unrelated app servers.
Checklist