From d23a8d5758046fc887d16b030e3a48964517e1b1 Mon Sep 17 00:00:00 2001 From: Yudai Nakata Date: Mon, 11 Sep 2023 14:39:53 +0900 Subject: [PATCH] Detect browsers in a Deno-compatible way (#821) --- src/utils/getEnvironment.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/getEnvironment.js b/src/utils/getEnvironment.js index da7d3ea..0971d99 100644 --- a/src/utils/getEnvironment.js +++ b/src/utils/getEnvironment.js @@ -7,7 +7,7 @@ module.exports = (key) => { env.type = 'webworker'; } else if (isElectron()) { env.type = 'electron'; - } else if (typeof window === 'object') { + } else if (typeof document === 'object') { env.type = 'browser'; } else if (typeof process === 'object' && typeof require === 'function') { env.type = 'node';