From 56ef2fc1756d4ab79914bc5566c6f01281e3e21b Mon Sep 17 00:00:00 2001 From: Eoghan Murray Date: Wed, 1 Apr 2026 12:00:00 +0800 Subject: [PATCH] Ignore noisy webgl params (#1016) * `isContextLost` is particularly noisy, being called almost constantly by e.g. Figma to check whether there's a need to re initialize a canvas Juice10: We could perhaps look at https://github.com/microsoft/TypeScript/blob/5cd49f6cbcd2effe9d425dee3a39cb49209bb656/lib/lib.dom.d.ts#L14578 via https://stackoverflow.com/questions/60150251/how-to-import-an-interface-from-lib-dom-d-ts * Apply formatting changes Co-authored-by: eoghanmurray --- packages/rrweb/src/record/observers/canvas/webgl.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/rrweb/src/record/observers/canvas/webgl.ts b/packages/rrweb/src/record/observers/canvas/webgl.ts index f3397d76..9e8bfbf4 100644 --- a/packages/rrweb/src/record/observers/canvas/webgl.ts +++ b/packages/rrweb/src/record/observers/canvas/webgl.ts @@ -24,6 +24,18 @@ function patchGLPrototype( const props = Object.getOwnPropertyNames(prototype); for (const prop of props) { + if ( + //prop.startsWith('get') || // e.g. getProgramParameter, but too risky + [ + 'isContextLost', + 'canvas', + 'drawingBufferWidth', + 'drawingBufferHeight', + ].includes(prop) + ) { + // skip read only propery/functions + continue; + } try { if (typeof prototype[prop as keyof typeof prototype] !== 'function') { continue;