From 7537b2ba3ac273eb50b99d184d1e9ac9deb4e3e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Wed, 30 Oct 2024 17:20:09 +0100 Subject: [PATCH] refactor: refine browser JS runtime detection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/runtime.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime.js b/src/runtime.js index 96d9e6c..00b63e4 100644 --- a/src/runtime.js +++ b/src/runtime.js @@ -5,7 +5,7 @@ const isDeno = !!globalThis.Deno const isNode = globalThis.process?.release?.name === 'node' // const isHermes = !!globalThis.HermesInternal // const isWorkerd = globalThis.navigator?.userAgent === 'Cloudflare-Workers' -const isBrowser = !!globalThis.navigator +const isBrowser = !!globalThis.window && !!globalThis.navigator export const runtime = (() => { if (isBun) return JSRuntime.bun