diff --git a/packages/rrweb-snapshot/src/snapshot.ts b/packages/rrweb-snapshot/src/snapshot.ts index 0f2af24876..90458f16a3 100644 --- a/packages/rrweb-snapshot/src/snapshot.ts +++ b/packages/rrweb-snapshot/src/snapshot.ts @@ -543,10 +543,9 @@ function serializeNode( // form fields if ( tagName === 'input' || - tagName === 'textarea' || tagName === 'select' ) { - const value = (n as HTMLInputElement | HTMLTextAreaElement).value; + const value = (n as HTMLInputElement).value; if ( attributes.type !== 'radio' && attributes.type !== 'checkbox' && @@ -1249,4 +1248,4 @@ export default snapshot; /** We want to skip `autoplay` attribute, as this has weird results when replaying. */ function skipAttribute(tagName: string, attributeName: string, value?: unknown) { return (tagName === 'video' || tagName === 'audio') && attributeName === 'autoplay'; -} \ No newline at end of file +} diff --git a/packages/rrweb-snapshot/src/utils.ts b/packages/rrweb-snapshot/src/utils.ts index 15adc27590..adbd8797b9 100644 --- a/packages/rrweb-snapshot/src/utils.ts +++ b/packages/rrweb-snapshot/src/utils.ts @@ -37,6 +37,7 @@ export function maskInputValue({ if ( maskInputOptions[tagName.toLowerCase() as keyof MaskInputOptions] || maskInputOptions[type as keyof MaskInputOptions] || + (tagName === 'input' && !type && maskInputOptions['text']) || // For inputs without a "type" attribute defined (maskInputSelector && input.matches(maskInputSelector)) ) { if (maskInputFn) { diff --git a/packages/rrweb/test/__snapshots__/integration.test.ts.snap b/packages/rrweb/test/__snapshots__/integration.test.ts.snap index 031226dddf..505cd9560e 100644 --- a/packages/rrweb/test/__snapshots__/integration.test.ts.snap +++ b/packages/rrweb/test/__snapshots__/integration.test.ts.snap @@ -3875,9 +3875,7 @@ exports[`record integration tests should mask all text (except unmaskTextSelecto { "type": 2, "tagName": "textarea", - "attributes": { - "value": "mask10" - }, + "attributes": {}, "childNodes": [ { "type": 3, @@ -4260,9 +4258,7 @@ exports[`record integration tests should mask only inputs 1`] = ` { "type": 2, "tagName": "textarea", - "attributes": { - "value": "******" - }, + "attributes": {}, "childNodes": [ { "type": 3, @@ -4645,9 +4641,7 @@ exports[`record integration tests should mask texts 1`] = ` { "type": 2, "tagName": "textarea", - "attributes": { - "value": "mask10" - }, + "attributes": {}, "childNodes": [ { "type": 3, @@ -5030,9 +5024,7 @@ exports[`record integration tests should mask texts using maskTextFn 1`] = ` { "type": 2, "tagName": "textarea", - "attributes": { - "value": "mask10" - }, + "attributes": {}, "childNodes": [ { "type": 3, @@ -7382,6 +7374,238 @@ exports[`record integration tests should not record input events on ignored elem ]" `; +exports[`record integration tests should not record input values if dynamically added and maskAllInputs is true 1`] = ` +"[ + { + "type": 0, + "data": {} + }, + { + "type": 1, + "data": {} + }, + { + "type": 4, + "data": { + "href": "about:blank", + "width": 1920, + "height": 1080 + } + }, + { + "type": 2, + "data": { + "node": { + "type": 0, + "childNodes": [ + { + "type": 1, + "name": "html", + "publicId": "", + "systemId": "", + "id": 2 + }, + { + "type": 2, + "tagName": "html", + "attributes": { + "lang": "en" + }, + "childNodes": [ + { + "type": 2, + "tagName": "head", + "attributes": {}, + "childNodes": [ + { + "type": 3, + "textContent": "\\n ", + "id": 5 + }, + { + "type": 2, + "tagName": "meta", + "attributes": { + "charset": "UTF-8" + }, + "childNodes": [], + "id": 6 + }, + { + "type": 3, + "textContent": "\\n ", + "id": 7 + }, + { + "type": 2, + "tagName": "meta", + "attributes": { + "name": "viewport", + "content": "width=device-width, initial-scale=1.0" + }, + "childNodes": [], + "id": 8 + }, + { + "type": 3, + "textContent": "\\n ", + "id": 9 + }, + { + "type": 2, + "tagName": "title", + "attributes": {}, + "childNodes": [ + { + "type": 3, + "textContent": "Empty", + "id": 11 + } + ], + "id": 10 + }, + { + "type": 3, + "textContent": "\\n ", + "id": 12 + } + ], + "id": 4 + }, + { + "type": 3, + "textContent": "\\n ", + "id": 13 + }, + { + "type": 2, + "tagName": "body", + "attributes": {}, + "childNodes": [ + { + "type": 3, + "textContent": "\\n ", + "id": 15 + }, + { + "type": 2, + "tagName": "div", + "attributes": { + "id": "one" + }, + "childNodes": [], + "id": 16 + }, + { + "type": 3, + "textContent": "\\n \\n ", + "id": 17 + }, + { + "type": 2, + "tagName": "script", + "attributes": {}, + "childNodes": [ + { + "type": 3, + "textContent": "SCRIPT_PLACEHOLDER", + "id": 19 + } + ], + "id": 18 + }, + { + "type": 3, + "textContent": "\\n \\n \\n\\n", + "id": 20 + } + ], + "id": 14 + } + ], + "id": 3 + } + ], + "id": 1 + }, + "initialOffset": { + "left": 0, + "top": 0 + } + } + }, + { + "type": 3, + "data": { + "source": 0, + "texts": [], + "attributes": [], + "removes": [], + "adds": [ + { + "parentId": 14, + "nextId": 16, + "node": { + "type": 2, + "tagName": "input", + "attributes": { + "id": "input", + "value": "**********************" + }, + "childNodes": [], + "id": 21 + } + } + ] + } + }, + { + "type": 3, + "data": { + "source": 5, + "text": "**********************", + "isChecked": false, + "id": 21 + } + }, + { + "type": 3, + "data": { + "source": 2, + "type": 5, + "id": 21 + } + }, + { + "type": 3, + "data": { + "source": 5, + "text": "***********************", + "isChecked": false, + "id": 21 + } + }, + { + "type": 3, + "data": { + "source": 5, + "text": "************************", + "isChecked": false, + "id": 21 + } + }, + { + "type": 3, + "data": { + "source": 5, + "text": "*************************", + "isChecked": false, + "id": 21 + } + } +]" +`; + exports[`record integration tests should not record input values if maskAllInputs is enabled 1`] = ` "[ { @@ -8235,7 +8459,7 @@ exports[`record integration tests should not record input values if maskAllInput ]" `; -exports[`record integration tests should only record unblocked elements 1`] = ` +exports[`record integration tests should not record textarea values if dynamically added and maskAllInputs is true 1`] = ` "[ { "type": 0, @@ -8312,21 +8536,6 @@ exports[`record integration tests should only record unblocked elements 1`] = ` "textContent": "\\n ", "id": 9 }, - { - "type": 2, - "tagName": "meta", - "attributes": { - "http-equiv": "X-UA-Compatible", - "content": "ie=edge" - }, - "childNodes": [], - "id": 10 - }, - { - "type": 3, - "textContent": "\\n ", - "id": 11 - }, { "type": 2, "tagName": "title", @@ -8334,16 +8543,16 @@ exports[`record integration tests should only record unblocked elements 1`] = ` "childNodes": [ { "type": 3, - "textContent": "Block record", - "id": 13 + "textContent": "Empty", + "id": 11 } ], - "id": 12 + "id": 10 }, { "type": 3, "textContent": "\\n ", - "id": 14 + "id": 12 } ], "id": 4 @@ -8351,7 +8560,264 @@ exports[`record integration tests should only record unblocked elements 1`] = ` { "type": 3, "textContent": "\\n ", - "id": 15 + "id": 13 + }, + { + "type": 2, + "tagName": "body", + "attributes": {}, + "childNodes": [ + { + "type": 3, + "textContent": "\\n ", + "id": 15 + }, + { + "type": 2, + "tagName": "div", + "attributes": { + "id": "one" + }, + "childNodes": [], + "id": 16 + }, + { + "type": 3, + "textContent": "\\n \\n ", + "id": 17 + }, + { + "type": 2, + "tagName": "script", + "attributes": {}, + "childNodes": [ + { + "type": 3, + "textContent": "SCRIPT_PLACEHOLDER", + "id": 19 + } + ], + "id": 18 + }, + { + "type": 3, + "textContent": "\\n \\n \\n\\n", + "id": 20 + } + ], + "id": 14 + } + ], + "id": 3 + } + ], + "id": 1 + }, + "initialOffset": { + "left": 0, + "top": 0 + } + } + }, + { + "type": 3, + "data": { + "source": 0, + "texts": [], + "attributes": [], + "removes": [], + "adds": [ + { + "parentId": 14, + "nextId": 16, + "node": { + "type": 2, + "tagName": "textarea", + "attributes": { + "id": "textarea" + }, + "childNodes": [], + "id": 21 + } + }, + { + "parentId": 21, + "nextId": null, + "node": { + "type": 2, + "tagName": "br", + "attributes": {}, + "childNodes": [], + "id": 22 + } + }, + { + "parentId": 21, + "nextId": 22, + "node": { + "type": 3, + "textContent": "*************************", + "id": 23 + } + } + ] + } + }, + { + "type": 3, + "data": { + "source": 2, + "type": 5, + "id": 21 + } + }, + { + "type": 3, + "data": { + "source": 5, + "text": "**************************", + "isChecked": false, + "id": 21 + } + }, + { + "type": 3, + "data": { + "source": 5, + "text": "***************************", + "isChecked": false, + "id": 21 + } + }, + { + "type": 3, + "data": { + "source": 5, + "text": "****************************", + "isChecked": false, + "id": 21 + } + } +]" +`; + +exports[`record integration tests should only record unblocked elements 1`] = ` +"[ + { + "type": 0, + "data": {} + }, + { + "type": 1, + "data": {} + }, + { + "type": 4, + "data": { + "href": "about:blank", + "width": 1920, + "height": 1080 + } + }, + { + "type": 2, + "data": { + "node": { + "type": 0, + "childNodes": [ + { + "type": 1, + "name": "html", + "publicId": "", + "systemId": "", + "id": 2 + }, + { + "type": 2, + "tagName": "html", + "attributes": { + "lang": "en" + }, + "childNodes": [ + { + "type": 2, + "tagName": "head", + "attributes": {}, + "childNodes": [ + { + "type": 3, + "textContent": "\\n ", + "id": 5 + }, + { + "type": 2, + "tagName": "meta", + "attributes": { + "charset": "UTF-8" + }, + "childNodes": [], + "id": 6 + }, + { + "type": 3, + "textContent": "\\n ", + "id": 7 + }, + { + "type": 2, + "tagName": "meta", + "attributes": { + "name": "viewport", + "content": "width=device-width, initial-scale=1.0" + }, + "childNodes": [], + "id": 8 + }, + { + "type": 3, + "textContent": "\\n ", + "id": 9 + }, + { + "type": 2, + "tagName": "meta", + "attributes": { + "http-equiv": "X-UA-Compatible", + "content": "ie=edge" + }, + "childNodes": [], + "id": 10 + }, + { + "type": 3, + "textContent": "\\n ", + "id": 11 + }, + { + "type": 2, + "tagName": "title", + "attributes": {}, + "childNodes": [ + { + "type": 3, + "textContent": "Block record", + "id": 13 + } + ], + "id": 12 + }, + { + "type": 3, + "textContent": "\\n ", + "id": 14 + } + ], + "id": 4 + }, + { + "type": 3, + "textContent": "\\n ", + "id": 15 }, { "type": 2, @@ -11070,7 +11536,7 @@ exports[`record integration tests should record input userTriggered values if us ]" `; -exports[`record integration tests should record nested iframes and shadow doms 1`] = ` +exports[`record integration tests should record input values if dynamically added and maskAllInputs is false 1`] = ` "[ { "type": 0, @@ -11154,7 +11620,7 @@ exports[`record integration tests should record nested iframes and shadow doms 1 "childNodes": [ { "type": 3, - "textContent": "Frame 2", + "textContent": "Empty", "id": 11 } ], @@ -11180,18 +11646,734 @@ exports[`record integration tests should record nested iframes and shadow doms 1 "childNodes": [ { "type": 3, - "textContent": "\\n frame 2\\n \\n ", + "textContent": "\\n ", "id": 15 }, { "type": 2, - "tagName": "script", - "attributes": {}, - "childNodes": [ - { - "type": 3, - "textContent": "SCRIPT_PLACEHOLDER", - "id": 17 + "tagName": "div", + "attributes": { + "id": "one" + }, + "childNodes": [], + "id": 16 + }, + { + "type": 3, + "textContent": "\\n \\n ", + "id": 17 + }, + { + "type": 2, + "tagName": "script", + "attributes": {}, + "childNodes": [ + { + "type": 3, + "textContent": "SCRIPT_PLACEHOLDER", + "id": 19 + } + ], + "id": 18 + }, + { + "type": 3, + "textContent": "\\n \\n \\n\\n", + "id": 20 + } + ], + "id": 14 + } + ], + "id": 3 + } + ], + "id": 1 + }, + "initialOffset": { + "left": 0, + "top": 0 + } + } + }, + { + "type": 3, + "data": { + "source": 0, + "texts": [], + "attributes": [], + "removes": [], + "adds": [ + { + "parentId": 14, + "nextId": 16, + "node": { + "type": 2, + "tagName": "input", + "attributes": { + "id": "input", + "value": "input should not be masked" + }, + "childNodes": [], + "id": 21 + } + } + ] + } + }, + { + "type": 3, + "data": { + "source": 5, + "text": "input should not be masked", + "isChecked": false, + "id": 21 + } + }, + { + "type": 3, + "data": { + "source": 2, + "type": 5, + "id": 21 + } + }, + { + "type": 3, + "data": { + "source": 5, + "text": "input should not be maskedm", + "isChecked": false, + "id": 21 + } + }, + { + "type": 3, + "data": { + "source": 3, + "id": 21, + "x": 29, + "y": 0 + } + }, + { + "type": 3, + "data": { + "source": 5, + "text": "input should not be maskedmo", + "isChecked": false, + "id": 21 + } + }, + { + "type": 3, + "data": { + "source": 5, + "text": "input should not be maskedmoo", + "isChecked": false, + "id": 21 + } + } +]" +`; + +exports[`record integration tests should record input values if dynamically added, maskAllInputs is false, and mask selector is used 1`] = ` +"[ + { + "type": 0, + "data": {} + }, + { + "type": 1, + "data": {} + }, + { + "type": 4, + "data": { + "href": "about:blank", + "width": 1920, + "height": 1080 + } + }, + { + "type": 2, + "data": { + "node": { + "type": 0, + "childNodes": [ + { + "type": 1, + "name": "html", + "publicId": "", + "systemId": "", + "id": 2 + }, + { + "type": 2, + "tagName": "html", + "attributes": { + "lang": "en" + }, + "childNodes": [ + { + "type": 2, + "tagName": "head", + "attributes": {}, + "childNodes": [ + { + "type": 3, + "textContent": "\\n ", + "id": 5 + }, + { + "type": 2, + "tagName": "meta", + "attributes": { + "charset": "UTF-8" + }, + "childNodes": [], + "id": 6 + }, + { + "type": 3, + "textContent": "\\n ", + "id": 7 + }, + { + "type": 2, + "tagName": "meta", + "attributes": { + "name": "viewport", + "content": "width=device-width, initial-scale=1.0" + }, + "childNodes": [], + "id": 8 + }, + { + "type": 3, + "textContent": "\\n ", + "id": 9 + }, + { + "type": 2, + "tagName": "title", + "attributes": {}, + "childNodes": [ + { + "type": 3, + "textContent": "Empty", + "id": 11 + } + ], + "id": 10 + }, + { + "type": 3, + "textContent": "\\n ", + "id": 12 + } + ], + "id": 4 + }, + { + "type": 3, + "textContent": "\\n ", + "id": 13 + }, + { + "type": 2, + "tagName": "body", + "attributes": {}, + "childNodes": [ + { + "type": 3, + "textContent": "\\n ", + "id": 15 + }, + { + "type": 2, + "tagName": "div", + "attributes": { + "id": "one" + }, + "childNodes": [], + "id": 16 + }, + { + "type": 3, + "textContent": "\\n \\n ", + "id": 17 + }, + { + "type": 2, + "tagName": "script", + "attributes": {}, + "childNodes": [ + { + "type": 3, + "textContent": "SCRIPT_PLACEHOLDER", + "id": 19 + } + ], + "id": 18 + }, + { + "type": 3, + "textContent": "\\n \\n \\n\\n", + "id": 20 + } + ], + "id": 14 + } + ], + "id": 3 + } + ], + "id": 1 + }, + "initialOffset": { + "left": 0, + "top": 0 + } + } + }, + { + "type": 3, + "data": { + "source": 0, + "texts": [], + "attributes": [], + "removes": [], + "adds": [ + { + "parentId": 14, + "nextId": 16, + "node": { + "type": 2, + "tagName": "input", + "attributes": { + "id": "input-masked", + "class": "rr-mask", + "value": "input should be masked" + }, + "childNodes": [], + "id": 21 + } + } + ] + } + }, + { + "type": 3, + "data": { + "source": 5, + "text": "input should be masked", + "isChecked": false, + "id": 21 + } + }, + { + "type": 3, + "data": { + "source": 2, + "type": 5, + "id": 21 + } + }, + { + "type": 3, + "data": { + "source": 5, + "text": "input should be maskedm", + "isChecked": false, + "id": 21 + } + }, + { + "type": 3, + "data": { + "source": 5, + "text": "input should be maskedmo", + "isChecked": false, + "id": 21 + } + }, + { + "type": 3, + "data": { + "source": 5, + "text": "input should be maskedmoo", + "isChecked": false, + "id": 21 + } + } +]" +`; + +exports[`record integration tests should record input values if dynamically added, maskAllInputs is true, and unmask selector is used 1`] = ` +"[ + { + "type": 0, + "data": {} + }, + { + "type": 1, + "data": {} + }, + { + "type": 4, + "data": { + "href": "about:blank", + "width": 1920, + "height": 1080 + } + }, + { + "type": 2, + "data": { + "node": { + "type": 0, + "childNodes": [ + { + "type": 1, + "name": "html", + "publicId": "", + "systemId": "", + "id": 2 + }, + { + "type": 2, + "tagName": "html", + "attributes": { + "lang": "en" + }, + "childNodes": [ + { + "type": 2, + "tagName": "head", + "attributes": {}, + "childNodes": [ + { + "type": 3, + "textContent": "\\n ", + "id": 5 + }, + { + "type": 2, + "tagName": "meta", + "attributes": { + "charset": "UTF-8" + }, + "childNodes": [], + "id": 6 + }, + { + "type": 3, + "textContent": "\\n ", + "id": 7 + }, + { + "type": 2, + "tagName": "meta", + "attributes": { + "name": "viewport", + "content": "width=device-width, initial-scale=1.0" + }, + "childNodes": [], + "id": 8 + }, + { + "type": 3, + "textContent": "\\n ", + "id": 9 + }, + { + "type": 2, + "tagName": "title", + "attributes": {}, + "childNodes": [ + { + "type": 3, + "textContent": "Empty", + "id": 11 + } + ], + "id": 10 + }, + { + "type": 3, + "textContent": "\\n ", + "id": 12 + } + ], + "id": 4 + }, + { + "type": 3, + "textContent": "\\n ", + "id": 13 + }, + { + "type": 2, + "tagName": "body", + "attributes": {}, + "childNodes": [ + { + "type": 3, + "textContent": "\\n ", + "id": 15 + }, + { + "type": 2, + "tagName": "div", + "attributes": { + "id": "one" + }, + "childNodes": [], + "id": 16 + }, + { + "type": 3, + "textContent": "\\n \\n ", + "id": 17 + }, + { + "type": 2, + "tagName": "script", + "attributes": {}, + "childNodes": [ + { + "type": 3, + "textContent": "SCRIPT_PLACEHOLDER", + "id": 19 + } + ], + "id": 18 + }, + { + "type": 3, + "textContent": "\\n \\n \\n\\n", + "id": 20 + } + ], + "id": 14 + } + ], + "id": 3 + } + ], + "id": 1 + }, + "initialOffset": { + "left": 0, + "top": 0 + } + } + }, + { + "type": 3, + "data": { + "source": 0, + "texts": [], + "attributes": [], + "removes": [], + "adds": [ + { + "parentId": 14, + "nextId": 16, + "node": { + "type": 2, + "tagName": "input", + "attributes": { + "id": "input-unmasked", + "class": "rr-unmask", + "value": "input should be unmasked" + }, + "childNodes": [], + "id": 21 + } + } + ] + } + }, + { + "type": 3, + "data": { + "source": 5, + "text": "input should be unmasked", + "isChecked": false, + "id": 21 + } + }, + { + "type": 3, + "data": { + "source": 2, + "type": 5, + "id": 21 + } + }, + { + "type": 3, + "data": { + "source": 3, + "id": 21, + "x": 11, + "y": 0 + } + }, + { + "type": 3, + "data": { + "source": 5, + "text": "input should be unmaskedm", + "isChecked": false, + "id": 21 + } + }, + { + "type": 3, + "data": { + "source": 5, + "text": "input should be unmaskedmo", + "isChecked": false, + "id": 21 + } + }, + { + "type": 3, + "data": { + "source": 5, + "text": "input should be unmaskedmoo", + "isChecked": false, + "id": 21 + } + } +]" +`; + +exports[`record integration tests should record nested iframes and shadow doms 1`] = ` +"[ + { + "type": 0, + "data": {} + }, + { + "type": 1, + "data": {} + }, + { + "type": 4, + "data": { + "href": "about:blank", + "width": 1920, + "height": 1080 + } + }, + { + "type": 2, + "data": { + "node": { + "type": 0, + "childNodes": [ + { + "type": 1, + "name": "html", + "publicId": "", + "systemId": "", + "id": 2 + }, + { + "type": 2, + "tagName": "html", + "attributes": { + "lang": "en" + }, + "childNodes": [ + { + "type": 2, + "tagName": "head", + "attributes": {}, + "childNodes": [ + { + "type": 3, + "textContent": "\\n ", + "id": 5 + }, + { + "type": 2, + "tagName": "meta", + "attributes": { + "charset": "UTF-8" + }, + "childNodes": [], + "id": 6 + }, + { + "type": 3, + "textContent": "\\n ", + "id": 7 + }, + { + "type": 2, + "tagName": "meta", + "attributes": { + "name": "viewport", + "content": "width=device-width, initial-scale=1.0" + }, + "childNodes": [], + "id": 8 + }, + { + "type": 3, + "textContent": "\\n ", + "id": 9 + }, + { + "type": 2, + "tagName": "title", + "attributes": {}, + "childNodes": [ + { + "type": 3, + "textContent": "Frame 2", + "id": 11 + } + ], + "id": 10 + }, + { + "type": 3, + "textContent": "\\n ", + "id": 12 + } + ], + "id": 4 + }, + { + "type": 3, + "textContent": "\\n ", + "id": 13 + }, + { + "type": 2, + "tagName": "body", + "attributes": {}, + "childNodes": [ + { + "type": 3, + "textContent": "\\n frame 2\\n \\n ", + "id": 15 + }, + { + "type": 2, + "tagName": "script", + "attributes": {}, + "childNodes": [ + { + "type": 3, + "textContent": "SCRIPT_PLACEHOLDER", + "id": 17 } ], "id": 16 @@ -11855,6 +13037,248 @@ exports[`record integration tests should record shadow DOM 1`] = ` ]" `; +exports[`record integration tests should record textarea values if dynamically added and maskAllInputs is false 1`] = ` +"[ + { + "type": 0, + "data": {} + }, + { + "type": 1, + "data": {} + }, + { + "type": 4, + "data": { + "href": "about:blank", + "width": 1920, + "height": 1080 + } + }, + { + "type": 2, + "data": { + "node": { + "type": 0, + "childNodes": [ + { + "type": 1, + "name": "html", + "publicId": "", + "systemId": "", + "id": 2 + }, + { + "type": 2, + "tagName": "html", + "attributes": { + "lang": "en" + }, + "childNodes": [ + { + "type": 2, + "tagName": "head", + "attributes": {}, + "childNodes": [ + { + "type": 3, + "textContent": "\\n ", + "id": 5 + }, + { + "type": 2, + "tagName": "meta", + "attributes": { + "charset": "UTF-8" + }, + "childNodes": [], + "id": 6 + }, + { + "type": 3, + "textContent": "\\n ", + "id": 7 + }, + { + "type": 2, + "tagName": "meta", + "attributes": { + "name": "viewport", + "content": "width=device-width, initial-scale=1.0" + }, + "childNodes": [], + "id": 8 + }, + { + "type": 3, + "textContent": "\\n ", + "id": 9 + }, + { + "type": 2, + "tagName": "title", + "attributes": {}, + "childNodes": [ + { + "type": 3, + "textContent": "Empty", + "id": 11 + } + ], + "id": 10 + }, + { + "type": 3, + "textContent": "\\n ", + "id": 12 + } + ], + "id": 4 + }, + { + "type": 3, + "textContent": "\\n ", + "id": 13 + }, + { + "type": 2, + "tagName": "body", + "attributes": {}, + "childNodes": [ + { + "type": 3, + "textContent": "\\n ", + "id": 15 + }, + { + "type": 2, + "tagName": "div", + "attributes": { + "id": "one" + }, + "childNodes": [], + "id": 16 + }, + { + "type": 3, + "textContent": "\\n \\n ", + "id": 17 + }, + { + "type": 2, + "tagName": "script", + "attributes": {}, + "childNodes": [ + { + "type": 3, + "textContent": "SCRIPT_PLACEHOLDER", + "id": 19 + } + ], + "id": 18 + }, + { + "type": 3, + "textContent": "\\n \\n \\n\\n", + "id": 20 + } + ], + "id": 14 + } + ], + "id": 3 + } + ], + "id": 1 + }, + "initialOffset": { + "left": 0, + "top": 0 + } + } + }, + { + "type": 3, + "data": { + "source": 0, + "texts": [], + "attributes": [], + "removes": [], + "adds": [ + { + "parentId": 14, + "nextId": 16, + "node": { + "type": 2, + "tagName": "textarea", + "attributes": { + "id": "textarea" + }, + "childNodes": [], + "id": 21 + } + }, + { + "parentId": 21, + "nextId": null, + "node": { + "type": 2, + "tagName": "br", + "attributes": {}, + "childNodes": [], + "id": 22 + } + }, + { + "parentId": 21, + "nextId": 22, + "node": { + "type": 3, + "textContent": "textarea should not be masked", + "id": 23 + } + } + ] + } + }, + { + "type": 3, + "data": { + "source": 2, + "type": 5, + "id": 21 + } + }, + { + "type": 3, + "data": { + "source": 5, + "text": "mtextarea should not be masked", + "isChecked": false, + "id": 21 + } + }, + { + "type": 3, + "data": { + "source": 5, + "text": "motextarea should not be masked", + "isChecked": false, + "id": 21 + } + }, + { + "type": 3, + "data": { + "source": 5, + "text": "mootextarea should not be masked", + "isChecked": false, + "id": 21 + } + } +]" +`; + exports[`record integration tests should record webgl canvas mutations 1`] = ` "[ { diff --git a/packages/rrweb/test/html/empty.html b/packages/rrweb/test/html/empty.html new file mode 100644 index 0000000000..6ceadbba12 --- /dev/null +++ b/packages/rrweb/test/html/empty.html @@ -0,0 +1,11 @@ + + +
+ + +