Set browser false when navigator object is empty

main
Augustin Chan 2023-12-06 18:03:29 +08:00 committed by Vladimir Mandic
parent 9d1239301c
commit 83964b02b1
1 changed files with 1 additions and 1 deletions

View File

@ -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';