diff --git a/src/util/env.ts b/src/util/env.ts index 33861781..f28adbee 100644 --- a/src/util/env.ts +++ b/src/util/env.ts @@ -99,7 +99,7 @@ export class Env { set ImageData(val) { this.#imageData = val; globalThis.ImageData = val; } constructor() { - this.browser = typeof navigator !== 'undefined'; + this.browser = typeof navigator !== 'undefined' && Object.keys(navigator).length !== 0; this.node = (typeof process !== 'undefined') && (typeof process.versions !== 'undefined') && (typeof process.versions.node !== 'undefined'); this.tfjs = { version: tf.version['tfjs-core'] }; this.offscreen = typeof OffscreenCanvas !== 'undefined';