Skip to content

Commit 6360009

Browse files
authored
feat(replay): ignore background-image when blockAllMedia is enabled (#18019)
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.
1 parent 72980d1 commit 6360009

File tree

6 files changed

+35
-25
lines changed

6 files changed

+35
-25
lines changed

.size-limit.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ module.exports = [
197197
path: createCDNPath('bundle.tracing.replay.min.js'),
198198
gzip: false,
199199
brotli: false,
200-
limit: '240 KB',
200+
limit: '245 KB',
201201
},
202202
{
203203
name: 'CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed',

packages/replay-canvas/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
},
6767
"homepage": "https://docs.sentry.io/platforms/javascript/session-replay/",
6868
"devDependencies": {
69-
"@sentry-internal/rrweb": "2.37.0"
69+
"@sentry-internal/rrweb": "2.40.0"
7070
},
7171
"dependencies": {
7272
"@sentry-internal/replay": "10.23.0",

packages/replay-internal/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@
8282
"devDependencies": {
8383
"@babel/core": "^7.27.7",
8484
"@sentry-internal/replay-worker": "10.23.0",
85-
"@sentry-internal/rrweb": "2.37.0",
86-
"@sentry-internal/rrweb-snapshot": "2.37.0",
85+
"@sentry-internal/rrweb": "2.40.0",
86+
"@sentry-internal/rrweb-snapshot": "2.40.0",
8787
"fflate": "0.8.2",
8888
"jest-matcher-utils": "^29.0.0",
8989
"jsdom-worker": "^0.3.0",

packages/replay-internal/src/integration.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ export class Replay implements Integration {
187187
this._recordingOptions.blockSelector = !this._recordingOptions.blockSelector
188188
? MEDIA_SELECTORS
189189
: `${this._recordingOptions.blockSelector},${MEDIA_SELECTORS}`;
190+
this._recordingOptions.ignoreCSSAttributes = new Set(['background-image']);
190191
}
191192

192193
if (this._isInitialized && isBrowser()) {

packages/replay-internal/test/integration/rrweb.test.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ describe('Integration | rrweb', () => {
2828
"collectFonts": true,
2929
"emit": [Function],
3030
"errorHandler": [Function],
31+
"ignoreCSSAttributes": Set {
32+
"background-image",
33+
},
3134
"ignoreSelector": ".sentry-test-ignore,.sentry-ignore,[data-sentry-ignore],input[type="file"]",
3235
"inlineImages": false,
3336
"inlineStylesheet": true,
@@ -69,6 +72,9 @@ describe('Integration | rrweb', () => {
6972
"collectFonts": true,
7073
"emit": [Function],
7174
"errorHandler": [Function],
75+
"ignoreCSSAttributes": Set {
76+
"background-image",
77+
},
7278
"ignoreSelector": ".sentry-ignore,[data-sentry-ignore],input[type="file"]",
7379
"inlineImages": false,
7480
"inlineStylesheet": true,
@@ -121,6 +127,9 @@ describe('Integration | rrweb', () => {
121127
"collectFonts": true,
122128
"emit": [Function],
123129
"errorHandler": [Function],
130+
"ignoreCSSAttributes": Set {
131+
"background-image",
132+
},
124133
"ignoreSelector": ".sentry-ignore,[data-sentry-ignore],input[type="file"]",
125134
"inlineImages": false,
126135
"inlineStylesheet": true,

yarn.lock

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6951,22 +6951,22 @@
69516951
dependencies:
69526952
"@sentry-internal/rrweb-snapshot" "2.34.0"
69536953

6954-
"@sentry-internal/rrdom@2.37.0":
6955-
version "2.37.0"
6956-
resolved "https://registry.yarnpkg.com/@sentry-internal/rrdom/-/rrdom-2.37.0.tgz#1aaf382eb7b543d7c256d31b73868e81e6649fbb"
6957-
integrity sha512-Wj6W4HP6kVYL1oenYq+Ec7QKtsq1Btk/acFLfZ/O7fygLVeAM0KZ4JZirPWdJmpeNNIk1YN7a8C7CfCiM014Ag==
6954+
"@sentry-internal/rrdom@2.40.0":
6955+
version "2.40.0"
6956+
resolved "https://registry.yarnpkg.com/@sentry-internal/rrdom/-/rrdom-2.40.0.tgz#2afd76ab6695a63e7b000cb3c101029cd2ccd48b"
6957+
integrity sha512-QBnn2F0qi4Lx7TZW41CdRek/vWWLZCDx1Ywc1SimBX+byuVmNP84qvnVI4wKMoDvU6AcQiWHAgX2tGoa3Ol8pw==
69586958
dependencies:
6959-
"@sentry-internal/rrweb-snapshot" "2.37.0"
6959+
"@sentry-internal/rrweb-snapshot" "2.40.0"
69606960

69616961
"@sentry-internal/rrweb-snapshot@2.34.0":
69626962
version "2.34.0"
69636963
resolved "https://registry.yarnpkg.com/@sentry-internal/rrweb-snapshot/-/rrweb-snapshot-2.34.0.tgz#79c2049b6c887e3c128d5fa80d6f745a61dd0e68"
69646964
integrity sha512-9Tb8jwVufn5GLV0d/CTuoZWo2O06ZB+xWeTJdEkbtJ6PAmO/Q7GQI3uNIx0pfFEnXP+0Km8CKKxpwkEM0z2m6w==
69656965

6966-
"@sentry-internal/rrweb-snapshot@2.37.0":
6967-
version "2.37.0"
6968-
resolved "https://registry.yarnpkg.com/@sentry-internal/rrweb-snapshot/-/rrweb-snapshot-2.37.0.tgz#2081d1827a108a08cab219234952744e6e79c06b"
6969-
integrity sha512-fu2/Fd5J5gJrAgQgl9WykVPQkMjo+9MVFy4Y88STTP3WWsLu1u75YAQM6Lr1/tLEykoQ4NecmNDdcz/DiB/nNg==
6966+
"@sentry-internal/rrweb-snapshot@2.40.0":
6967+
version "2.40.0"
6968+
resolved "https://registry.yarnpkg.com/@sentry-internal/rrweb-snapshot/-/rrweb-snapshot-2.40.0.tgz#873e9be9967d7e4b6518beb7d9dfbdf5bbe043ac"
6969+
integrity sha512-uxYlYUIiybRqcyp5go46G5lcOswTFfeen8PelYVQsiLX34I7eugNfLgFchpBdiWv1FXwsautBWyOsZlxCPc3Zw==
69706970

69716971
"@sentry-internal/rrweb-types@2.34.0":
69726972
version "2.34.0"
@@ -6976,12 +6976,12 @@
69766976
"@sentry-internal/rrweb-snapshot" "2.34.0"
69776977
"@types/css-font-loading-module" "0.0.7"
69786978

6979-
"@sentry-internal/rrweb-types@2.37.0":
6980-
version "2.37.0"
6981-
resolved "https://registry.yarnpkg.com/@sentry-internal/rrweb-types/-/rrweb-types-2.37.0.tgz#edc91ee032896788fa9a6f96c76f1f6dd7c9f538"
6982-
integrity sha512-ydtHzfGFO6Tyw4n7yOLUrdaNKmRdyaVfqNgObEbEgO/qobzxBV5zf8eNApTayy6SOji3NrF8PpJzm55OX/ChNA==
6979+
"@sentry-internal/rrweb-types@2.40.0":
6980+
version "2.40.0"
6981+
resolved "https://registry.yarnpkg.com/@sentry-internal/rrweb-types/-/rrweb-types-2.40.0.tgz#0c16376b83d264548f67e757dc28ae01d2e46991"
6982+
integrity sha512-d4MB1NI7KeomX0vRy0E7OQJHI+WvbeKvwAHqG/xV94A4ZscKkF7DoAQUvyeBsFf3tED/SuwV75HNEnq2uwk/cQ==
69836983
dependencies:
6984-
"@sentry-internal/rrweb-snapshot" "2.37.0"
6984+
"@sentry-internal/rrweb-snapshot" "2.40.0"
69856985
"@types/css-font-loading-module" "0.0.7"
69866986

69876987
"@sentry-internal/rrweb@2.34.0":
@@ -6998,14 +6998,14 @@
69986998
fflate "^0.4.4"
69996999
mitt "^3.0.0"
70007000

7001-
"@sentry-internal/rrweb@2.37.0":
7002-
version "2.37.0"
7003-
resolved "https://registry.yarnpkg.com/@sentry-internal/rrweb/-/rrweb-2.37.0.tgz#8ea0eb906e194060c60f4a6af4a0d3a16d52cdec"
7004-
integrity sha512-erN53M1WSPGpsMw+iVX6qWhI4id41+2AXcnALoB2JIyL/Q1W8f2loq/a4PxWkhaaq7mtGiHTmNTbks8Qgrsl9g==
7001+
"@sentry-internal/rrweb@2.40.0":
7002+
version "2.40.0"
7003+
resolved "https://registry.yarnpkg.com/@sentry-internal/rrweb/-/rrweb-2.40.0.tgz#9d60899800f21f061f38b1b62ddc64df1ff525bb"
7004+
integrity sha512-niFva5QmCTfavotLvIeFSvO0rfzbJwW04igcPaWAqTDATi+Xife27iBeVMBmjpHEWygGYkBaGyBQUUi8zUdAyg==
70057005
dependencies:
7006-
"@sentry-internal/rrdom" "2.37.0"
7007-
"@sentry-internal/rrweb-snapshot" "2.37.0"
7008-
"@sentry-internal/rrweb-types" "2.37.0"
7006+
"@sentry-internal/rrdom" "2.40.0"
7007+
"@sentry-internal/rrweb-snapshot" "2.40.0"
7008+
"@sentry-internal/rrweb-types" "2.40.0"
70097009
"@types/css-font-loading-module" "0.0.7"
70107010
"@xstate/fsm" "^1.4.0"
70117011
base64-arraybuffer "^1.0.1"

0 commit comments

Comments
 (0)