Skip to content

Commit b290002

Browse files
author
Alexander Kovelenov
committed
Fix console warning in Firefox
1 parent 54e765f commit b290002

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,8 @@ export const getGPUTier = async ({
170170
return toResult(0, 'WEBGL_UNSUPPORTED');
171171
}
172172

173-
const debugRendererInfo = gl.getExtension('WEBGL_debug_renderer_info');
173+
// NOTE: fixes console warning in Firefox
174+
const debugRendererInfo = deviceInfo?.isFirefox ? null : gl.getExtension('WEBGL_debug_renderer_info');
174175

175176
if (debugRendererInfo) {
176177
renderer = gl.getParameter(debugRendererInfo.UNMASKED_RENDERER_WEBGL);

src/internal/deviceInfo.js

+3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,12 @@ export const deviceInfo = (() => {
1818

1919
const isAndroid = /android/i.test(userAgent);
2020

21+
const isFirefox = /Firefox/.test(userAgent);
22+
2123
return {
2224
isIpad,
2325
isMobile: isAndroid || isIOS || isIpad,
2426
isSafari12: /Version\/12.+Safari/.test(userAgent),
27+
isFirefox,
2528
};
2629
})();

0 commit comments

Comments
 (0)