Commit 1f7525e
authored
replay: add dd-privacy attribute for obfuscation & ignoring input (#715)
* recorder: introduce helpers to obfuscate elements
Adds the nodeIsHidden & nodeOrAncestorsAreHidden helpers.
These helpers, part of the new "privacy" file, replace rrweb's
isBlocked() and rrweb-snapshot's _isBlockedElement() functions.
They do not rely on the blockClass variable (removed in a later
commit), but instead use constants defined within the same file.
An element is considered hidden if it has the data attribute
"data-dd-privacy" set to "hidden" or a class of "dd-privacy-hidden".
* recorder: introduce helpers to ignore input
Adds the nodeHasInputIngored & nodeOrAncestorsHaveInputIngnored
helpers.
These helpers will return true when a node should have it's input
ignored, either because an attribute/class is set, or because it's a
kind of input we don't want to track.
They do not rely on the ignoreClass variable (removed in a later
commit), but instead use constants defined within the same file.
An element is considered ignored if it has the data attribute
"data-dd-privacy" set to "input-ignored", a class of
"dd-privacy-input-ingored", or a type of "email", "password" or "tel".
* recorder: add unit tests for obfuscation & input ignore
* e2e: update appium version
Calls to setValue() would fail with 1.9.1:
Error: invalid argument: 'value' must be a list
(Session info: chrome=86.0.4240.198)
(Driver info: chromedriver=86.0.4240.22 (398b0743353ff36fb1b82468f63a3a93b4e2e89e-refs/branch-heads/4240@{#378}),platform=Linux 4.1.13-101.fc21.x86_64 x86_64)
* recorder: add e2e tests for obfuscation & input ignore
* recorder: remove unused variables
blockClass, blockSelector, and ignoreClass are now unused
* recorder: rename helpers
Renames:
- nodeIsHidden to nodeShouldBeHidden
- nodeOrAncestorsAreHidden to nodeOrAncestorsShouldBeHidden
- nodeHasInputIngored to nodeShouldHaveInputIngored
- nodeOrAncestorsHaveInputIngnored to nodeOrAncestorsShouldHaveInputIngnored
* recorder: rename ElementNode's needBlock to shouldBeHidden1 parent 6ecac3f commit 1f7525e
File tree
13 files changed
+387
-165
lines changed- packages/rum-recorder/src/domain
- rrweb-snapshot
- rrweb
- test/e2e
- lib/helpers
- scenario
13 files changed
+387
-165
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
Lines changed: 8 additions & 52 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | 162 | | |
186 | 163 | | |
187 | 164 | | |
188 | 165 | | |
189 | | - | |
190 | | - | |
191 | 166 | | |
192 | 167 | | |
193 | 168 | | |
194 | 169 | | |
195 | 170 | | |
196 | | - | |
| 171 | + | |
197 | 172 | | |
198 | 173 | | |
199 | 174 | | |
| |||
208 | 183 | | |
209 | 184 | | |
210 | 185 | | |
211 | | - | |
| 186 | + | |
212 | 187 | | |
213 | 188 | | |
214 | 189 | | |
| |||
276 | 251 | | |
277 | 252 | | |
278 | 253 | | |
279 | | - | |
| 254 | + | |
280 | 255 | | |
281 | 256 | | |
282 | 257 | | |
| |||
290 | 265 | | |
291 | 266 | | |
292 | 267 | | |
293 | | - | |
| 268 | + | |
294 | 269 | | |
295 | 270 | | |
296 | 271 | | |
| |||
407 | 382 | | |
408 | 383 | | |
409 | 384 | | |
410 | | - | |
411 | | - | |
412 | 385 | | |
413 | 386 | | |
414 | 387 | | |
| |||
420 | 393 | | |
421 | 394 | | |
422 | 395 | | |
423 | | - | |
424 | | - | |
425 | 396 | | |
426 | 397 | | |
427 | 398 | | |
| |||
431 | 402 | | |
432 | 403 | | |
433 | 404 | | |
434 | | - | |
435 | | - | |
436 | 405 | | |
437 | 406 | | |
438 | 407 | | |
| |||
466 | 435 | | |
467 | 436 | | |
468 | 437 | | |
469 | | - | |
| 438 | + | |
470 | 439 | | |
471 | | - | |
| 440 | + | |
472 | 441 | | |
473 | 442 | | |
474 | 443 | | |
| |||
483 | 452 | | |
484 | 453 | | |
485 | 454 | | |
486 | | - | |
487 | | - | |
488 | 455 | | |
489 | 456 | | |
490 | 457 | | |
| |||
503 | 470 | | |
504 | 471 | | |
505 | 472 | | |
506 | | - | |
507 | 473 | | |
508 | 474 | | |
509 | 475 | | |
510 | 476 | | |
511 | | - | |
512 | 477 | | |
513 | 478 | | |
514 | | - | |
515 | | - | |
516 | | - | |
517 | | - | |
518 | | - | |
519 | | - | |
520 | | - | |
521 | | - | |
| 479 | + | |
522 | 480 | | |
523 | 481 | | |
524 | 482 | | |
| |||
565 | 523 | | |
566 | 524 | | |
567 | 525 | | |
568 | | - | |
569 | | - | |
570 | 526 | | |
571 | 527 | | |
572 | 528 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
34 | 32 | | |
35 | 33 | | |
36 | 34 | | |
| |||
0 commit comments