From 2dff1e14290ce626065c7adf09ecb1064b07c2d9 Mon Sep 17 00:00:00 2001 From: Reinder Nijhoff Date: Mon, 8 Apr 2024 16:18:49 +0200 Subject: [PATCH] fix isMobile check --- src/lib/FastImageSequence.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/FastImageSequence.ts b/src/lib/FastImageSequence.ts index 08bcbc2..c53228d 100644 --- a/src/lib/FastImageSequence.ts +++ b/src/lib/FastImageSequence.ts @@ -3,7 +3,7 @@ import Frame from "./Frame.js"; import {ImageFetchWorker} from "./ImageFetchWorker.js"; export function isMobile(): boolean { - return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent); + return (typeof navigator !== "undefined" && /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)); } /**