Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/rrweb-snapshot/src/snapshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1283,6 +1283,7 @@ function snapshot(
textarea: true,
select: true,
password: true,
hidden: true,
}
: maskAllInputs === false
? {
Expand Down
1 change: 1 addition & 0 deletions packages/rrweb-snapshot/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export type MaskInputOptions = Partial<{
textarea: boolean;
select: boolean;
password: boolean;
hidden: boolean;
}>;

export type SlimDOMOptions = Partial<{
Expand Down
1 change: 1 addition & 0 deletions packages/rrweb/src/record/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ function record<T = eventWithTime>(
textarea: true,
select: true,
password: true,
hidden: true,
}
: _maskInputOptions !== undefined
? _maskInputOptions
Expand Down
125 changes: 100 additions & 25 deletions packages/rrweb/test/__snapshots__/integration.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2952,16 +2952,31 @@ exports[`record integration tests > can record form interactions 1`] = `
},
{
\\"type\\": 3,
\\"textContent\\": \\"\\\\n \\",
\\"textContent\\": \\"\\\\n \\",
\\"id\\": 63
},
{
\\"type\\": 2,
\\"tagName\\": \\"input\\",
\\"attributes\\": {
\\"type\\": \\"hidden\\",
\\"value\\": \\"123456\\"
},
\\"childNodes\\": [],
\\"id\\": 64
},
{
\\"type\\": 3,
\\"textContent\\": \\"\\\\n \\",
\\"id\\": 65
}
],
\\"id\\": 18
},
{
\\"type\\": 3,
\\"textContent\\": \\"\\\\n \\\\n \\",
\\"id\\": 64
\\"id\\": 66
},
{
\\"type\\": 2,
Expand All @@ -2971,15 +2986,15 @@ exports[`record integration tests > can record form interactions 1`] = `
{
\\"type\\": 3,
\\"textContent\\": \\"SCRIPT_PLACEHOLDER\\",
\\"id\\": 66
\\"id\\": 68
}
],
\\"id\\": 65
\\"id\\": 67
},
{
\\"type\\": 3,
\\"textContent\\": \\"\\\\n \\\\n \\\\n\\\\n\\",
\\"id\\": 67
\\"id\\": 69
}
],
\\"id\\": 16
Expand Down Expand Up @@ -4936,16 +4951,31 @@ exports[`record integration tests > can use maskInputOptions to configure which
},
{
\\"type\\": 3,
\\"textContent\\": \\"\\\\n \\",
\\"textContent\\": \\"\\\\n \\",
\\"id\\": 63
},
{
\\"type\\": 2,
\\"tagName\\": \\"input\\",
\\"attributes\\": {
\\"type\\": \\"hidden\\",
\\"value\\": \\"123456\\"
},
\\"childNodes\\": [],
\\"id\\": 64
},
{
\\"type\\": 3,
\\"textContent\\": \\"\\\\n \\",
\\"id\\": 65
}
],
\\"id\\": 18
},
{
\\"type\\": 3,
\\"textContent\\": \\"\\\\n \\\\n \\",
\\"id\\": 64
\\"id\\": 66
},
{
\\"type\\": 2,
Expand All @@ -4955,15 +4985,15 @@ exports[`record integration tests > can use maskInputOptions to configure which
{
\\"type\\": 3,
\\"textContent\\": \\"SCRIPT_PLACEHOLDER\\",
\\"id\\": 66
\\"id\\": 68
}
],
\\"id\\": 65
\\"id\\": 67
},
{
\\"type\\": 3,
\\"textContent\\": \\"\\\\n \\\\n \\\\n\\\\n\\",
\\"id\\": 67
\\"id\\": 69
}
],
\\"id\\": 16
Expand Down Expand Up @@ -6763,16 +6793,31 @@ exports[`record integration tests > should mask inputs via function call 1`] = `
},
{
\\"type\\": 3,
\\"textContent\\": \\"\\\\n \\",
\\"textContent\\": \\"\\\\n \\",
\\"id\\": 63
},
{
\\"type\\": 2,
\\"tagName\\": \\"input\\",
\\"attributes\\": {
\\"type\\": \\"hidden\\",
\\"value\\": \\"******\\"
},
\\"childNodes\\": [],
\\"id\\": 64
},
{
\\"type\\": 3,
\\"textContent\\": \\"\\\\n \\",
\\"id\\": 65
}
],
\\"id\\": 18
},
{
\\"type\\": 3,
\\"textContent\\": \\"\\\\n \\\\n \\",
\\"id\\": 64
\\"id\\": 66
},
{
\\"type\\": 2,
Expand All @@ -6782,15 +6827,15 @@ exports[`record integration tests > should mask inputs via function call 1`] = `
{
\\"type\\": 3,
\\"textContent\\": \\"SCRIPT_PLACEHOLDER\\",
\\"id\\": 66
\\"id\\": 68
}
],
\\"id\\": 65
\\"id\\": 67
},
{
\\"type\\": 3,
\\"textContent\\": \\"\\\\n \\\\n \\\\n\\\\n\\",
\\"id\\": 67
\\"id\\": 69
}
],
\\"id\\": 16
Expand Down Expand Up @@ -10591,16 +10636,31 @@ exports[`record integration tests > should not record input values if maskAllInp
},
{
\\"type\\": 3,
\\"textContent\\": \\"\\\\n \\",
\\"textContent\\": \\"\\\\n \\",
\\"id\\": 63
},
{
\\"type\\": 2,
\\"tagName\\": \\"input\\",
\\"attributes\\": {
\\"type\\": \\"hidden\\",
\\"value\\": \\"******\\"
},
\\"childNodes\\": [],
\\"id\\": 64
},
{
\\"type\\": 3,
\\"textContent\\": \\"\\\\n \\",
\\"id\\": 65
}
],
\\"id\\": 18
},
{
\\"type\\": 3,
\\"textContent\\": \\"\\\\n \\\\n \\",
\\"id\\": 64
\\"id\\": 66
},
{
\\"type\\": 2,
Expand All @@ -10610,15 +10670,15 @@ exports[`record integration tests > should not record input values if maskAllInp
{
\\"type\\": 3,
\\"textContent\\": \\"SCRIPT_PLACEHOLDER\\",
\\"id\\": 66
\\"id\\": 68
}
],
\\"id\\": 65
\\"id\\": 67
},
{
\\"type\\": 3,
\\"textContent\\": \\"\\\\n \\\\n \\\\n\\\\n\\",
\\"id\\": 67
\\"id\\": 69
}
],
\\"id\\": 16
Expand Down Expand Up @@ -13705,16 +13765,31 @@ exports[`record integration tests > should record input userTriggered values if
},
{
\\"type\\": 3,
\\"textContent\\": \\"\\\\n \\",
\\"textContent\\": \\"\\\\n \\",
\\"id\\": 63
},
{
\\"type\\": 2,
\\"tagName\\": \\"input\\",
\\"attributes\\": {
\\"type\\": \\"hidden\\",
\\"value\\": \\"123456\\"
},
\\"childNodes\\": [],
\\"id\\": 64
},
{
\\"type\\": 3,
\\"textContent\\": \\"\\\\n \\",
\\"id\\": 65
}
],
\\"id\\": 18
},
{
\\"type\\": 3,
\\"textContent\\": \\"\\\\n \\\\n \\",
\\"id\\": 64
\\"id\\": 66
},
{
\\"type\\": 2,
Expand All @@ -13724,15 +13799,15 @@ exports[`record integration tests > should record input userTriggered values if
{
\\"type\\": 3,
\\"textContent\\": \\"SCRIPT_PLACEHOLDER\\",
\\"id\\": 66
\\"id\\": 68
}
],
\\"id\\": 65
\\"id\\": 67
},
{
\\"type\\": 3,
\\"textContent\\": \\"\\\\n \\\\n \\\\n\\\\n\\",
\\"id\\": 67
\\"id\\": 69
}
],
\\"id\\": 16
Expand Down
1 change: 1 addition & 0 deletions packages/rrweb/test/html/form.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
<input type="password" />
</label>
<textarea>pre value</textarea>
<input type="hidden" value="123456">
</form>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -1438,9 +1438,26 @@ exports[`cross origin iframes > form.html > should map input events correctly 1`
},
{
\\"type\\": 3,
\\"textContent\\": \\"\\\\n \\",
\\"textContent\\": \\"\\\\n \\",
\\"rootId\\": 11,
\\"id\\": 75
},
{
\\"type\\": 2,
\\"tagName\\": \\"input\\",
\\"attributes\\": {
\\"type\\": \\"hidden\\",
\\"value\\": \\"123456\\"
},
\\"childNodes\\": [],
\\"rootId\\": 11,
\\"id\\": 76
},
{
\\"type\\": 3,
\\"textContent\\": \\"\\\\n \\",
\\"rootId\\": 11,
\\"id\\": 77
}
],
\\"rootId\\": 11,
Expand All @@ -1450,7 +1467,7 @@ exports[`cross origin iframes > form.html > should map input events correctly 1`
\\"type\\": 3,
\\"textContent\\": \\"\\\\n \\\\n\\\\n\\",
\\"rootId\\": 11,
\\"id\\": 76
\\"id\\": 78
}
],
\\"rootId\\": 11,
Expand Down Expand Up @@ -2451,9 +2468,26 @@ exports[`cross origin iframes > form.html > should map scroll events correctly 1
},
{
\\"type\\": 3,
\\"textContent\\": \\"\\\\n \\",
\\"textContent\\": \\"\\\\n \\",
\\"rootId\\": 11,
\\"id\\": 75
},
{
\\"type\\": 2,
\\"tagName\\": \\"input\\",
\\"attributes\\": {
\\"type\\": \\"hidden\\",
\\"value\\": \\"123456\\"
},
\\"childNodes\\": [],
\\"rootId\\": 11,
\\"id\\": 76
},
{
\\"type\\": 3,
\\"textContent\\": \\"\\\\n \\",
\\"rootId\\": 11,
\\"id\\": 77
}
],
\\"rootId\\": 11,
Expand All @@ -2463,7 +2497,7 @@ exports[`cross origin iframes > form.html > should map scroll events correctly 1
\\"type\\": 3,
\\"textContent\\": \\"\\\\n \\\\n\\\\n\\",
\\"rootId\\": 11,
\\"id\\": 76
\\"id\\": 78
}
],
\\"rootId\\": 11,
Expand Down