-
-
Couldn't load subscription status.
- Fork 1.7k
feat(replay): ignore background-image when blockAllMedia is enabled
#18019
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
base: develop
Are you sure you want to change the base?
Conversation
size-limit report 📦
|
node-overhead report 🧳Note: This is a synthetic benchmark with a minimal express app and does not necessarily reflect the real-world performance impact in an application.
|
Pass `ignoreCSSAttributes` with `background-imgae` to ignore background images when `blockAllMedia` is enabled. `ignoreCSSAttributes` was expanded in [this PR](getsentry/rrweb#252) so that it also works for inline styles.
83a5467 to
a6b7d3d
Compare
| this._recordingOptions.blockSelector = !this._recordingOptions.blockSelector | ||
| ? MEDIA_SELECTORS | ||
| : `${this._recordingOptions.blockSelector},${MEDIA_SELECTORS}`; | ||
| this._recordingOptions.ignoreCSSAttributes = new Set(['background-image']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Media Block Overwrites CSS Ignore Settings
When blockAllMedia is enabled, this._recordingOptions.ignoreCSSAttributes is unconditionally overwritten with a new Set containing only 'background-image'. This causes any previously configured ignored CSS attributes to be lost, unlike the merging behavior for blockSelector.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't publicly expose ignoreCSSAttributes so we won't be overwriting anything
|
@sentry review |
| : `${this._recordingOptions.blockSelector},${MEDIA_SELECTORS}`; | ||
| this._recordingOptions.ignoreCSSAttributes = new Set(['background-image']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ignoreCSSAttributes is unconditionally set here, which will override any user-provided configuration. Consider checking if it's already set before assigning it, or merging with existing values if the property supports it. This ensures that user-provided configurations are respected and not silently overwritten.
Severity: MEDIUM
🤖 Prompt for AI Agent
Fix this code. In packages/replay-internal/src/integration.ts#L189-L190: The
`ignoreCSSAttributes` is unconditionally set here, which will override any user-provided
configuration. Consider checking if it's already set before assigning it, or merging
with existing values if the property supports it. This ensures that user-provided
configurations are respected and not silently overwritten.
Did we get this right? 👍 / 👎 to inform future reviews.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sentry can you check that we allow the user to provide ignoreCSSAttributes?
Pass
ignoreCSSAttributeswithbackground-imgaeto ignore background images whenblockAllMediais enabled.ignoreCSSAttributeswas expanded in this PR so that it also works for inline styles.