diff --git a/src/lib/is-browser.ts b/src/lib/is-browser.ts index cdf926a3e..d614d8be5 100644 --- a/src/lib/is-browser.ts +++ b/src/lib/is-browser.ts @@ -25,6 +25,9 @@ const isStandardBrowserEnv = () => { return false } +const isTxikijsEnv = () => + typeof navigator !== 'undefined' && navigator.userAgent === 'txiki.js' + const isWebWorkerEnv = () => Boolean( // eslint-disable-next-line no-restricted-globals @@ -37,7 +40,10 @@ const isReactNativeEnv = () => typeof navigator !== 'undefined' && navigator.product === 'ReactNative' const isBrowser = - isStandardBrowserEnv() || isWebWorkerEnv() || isReactNativeEnv() + isStandardBrowserEnv() || + isWebWorkerEnv() || + isReactNativeEnv() || + isTxikijsEnv() export const isWebWorker = isWebWorkerEnv()