Skip to content

Commit

Permalink
Set browser false when navigator object is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
augchan42 authored and vladmandic committed Dec 6, 2023
1 parent 9d12393 commit 83964b0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/util/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit 83964b0

Please sign in to comment.