@@ -167,6 +167,7 @@ function serializeNode(
167
167
blockClass : string | RegExp ,
168
168
inlineStylesheet : boolean ,
169
169
maskInputOptions : MaskInputOptions = { } ,
170
+ recordCanvas : boolean ,
170
171
) : serializedNode | false {
171
172
switch ( n . nodeType ) {
172
173
case n . DOCUMENT_NODE :
@@ -260,7 +261,7 @@ function serializeNode(
260
261
}
261
262
}
262
263
// canvas image data
263
- if ( tagName === 'canvas' ) {
264
+ if ( tagName === 'canvas' && recordCanvas ) {
264
265
attributes . rr_dataURL = ( n as HTMLCanvasElement ) . toDataURL ( ) ;
265
266
}
266
267
// media elements
@@ -330,13 +331,15 @@ export function serializeNodeWithId(
330
331
skipChild = false ,
331
332
inlineStylesheet = true ,
332
333
maskInputOptions ?: MaskInputOptions ,
334
+ recordCanvas ?: boolean ,
333
335
) : serializedNodeWithId | null {
334
336
const _serializedNode = serializeNode (
335
337
n ,
336
338
doc ,
337
339
blockClass ,
338
340
inlineStylesheet ,
339
341
maskInputOptions ,
342
+ recordCanvas || false ,
340
343
) ;
341
344
if ( ! _serializedNode ) {
342
345
// TODO: dev only
@@ -373,6 +376,7 @@ export function serializeNodeWithId(
373
376
skipChild ,
374
377
inlineStylesheet ,
375
378
maskInputOptions ,
379
+ recordCanvas ,
376
380
) ;
377
381
if ( serializedChildNode ) {
378
382
serializedNode . childNodes . push ( serializedChildNode ) ;
@@ -387,6 +391,7 @@ function snapshot(
387
391
blockClass : string | RegExp = 'rr-block' ,
388
392
inlineStylesheet = true ,
389
393
maskAllInputsOrOptions : boolean | MaskInputOptions ,
394
+ recordCanvas ?: boolean ,
390
395
) : [ serializedNodeWithId | null , idNodeMap ] {
391
396
const idNodeMap : idNodeMap = { } ;
392
397
const maskInputOptions : MaskInputOptions =
@@ -420,6 +425,7 @@ function snapshot(
420
425
false ,
421
426
inlineStylesheet ,
422
427
maskInputOptions ,
428
+ recordCanvas ,
423
429
) ,
424
430
idNodeMap ,
425
431
] ;
0 commit comments