fix: Validate if WebGLRenderingContext exists before capturing it (#1777)
* Update webgl.ts --------- Co-authored-by: Paul D'Ambra <paul.dambra@gmail.com> Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
42c203d24f
commit
8df3133af5
5
.changeset/healthy-glasses-shout.md
Normal file
5
.changeset/healthy-glasses-shout.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@rrweb/record": patch
|
||||
---
|
||||
|
||||
Validate if WebGLRenderingContext exists before capturing it
|
||||
@@ -95,16 +95,18 @@ export default function initCanvasWebGLMutationObserver(
|
||||
): listenerHandler {
|
||||
const handlers: listenerHandler[] = [];
|
||||
|
||||
handlers.push(
|
||||
...patchGLPrototype(
|
||||
win.WebGLRenderingContext.prototype,
|
||||
CanvasContext.WebGL,
|
||||
cb,
|
||||
blockClass,
|
||||
blockSelector,
|
||||
win,
|
||||
),
|
||||
);
|
||||
if (typeof win.WebGLRenderingContext !== 'undefined') {
|
||||
handlers.push(
|
||||
...patchGLPrototype(
|
||||
win.WebGLRenderingContext.prototype,
|
||||
CanvasContext.WebGL,
|
||||
cb,
|
||||
blockClass,
|
||||
blockSelector,
|
||||
win,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
if (typeof win.WebGL2RenderingContext !== 'undefined') {
|
||||
handlers.push(
|
||||
|
||||
Reference in New Issue
Block a user