Do not assume window is defined
It is notably not the case in web workers.
This commit is contained in:
@@ -41,7 +41,7 @@ let WEBGL_EXTENSIONS; // value is set below
|
||||
let HAS_WEBGL = false;
|
||||
|
||||
|
||||
if ('WebGLRenderingContext' in window) {
|
||||
if (typeof window !== 'undefined' && 'WebGLRenderingContext' in window) {
|
||||
try {
|
||||
const canvas = /** @type {HTMLCanvasElement} */
|
||||
(document.createElement('CANVAS'));
|
||||
|
||||
Reference in New Issue
Block a user