Patch out unsafe usage of navigator and window in node envs

This commit is contained in:
Daniel Imms
2024-07-10 06:22:16 -07:00
parent b401865957
commit 27195b003a
5 changed files with 10 additions and 11 deletions
+1 -1
View File
@@ -98,7 +98,7 @@ export function isFullscreen(targetWindow: Window): boolean {
}
export const onDidChangeFullscreen = WindowManager.INSTANCE.onDidChangeFullscreen;
const userAgent = navigator.userAgent;
const userAgent = typeof navigator === 'object' ? navigator.userAgent : '';
export const isFirefox = (userAgent.indexOf('Firefox') >= 0);
export const isWebKit = (userAgent.indexOf('AppleWebKit') >= 0);