Workaround crash that can happen in Electron/Chromium

Part of microsoft/vscode#189753
This commit is contained in:
Daniel Imms
2023-08-15 06:46:35 -07:00
parent c908eeed5c
commit 2ca0ccbe0c
2 changed files with 10 additions and 4 deletions
+1
View File
@@ -17,6 +17,7 @@ export const isNode = (typeof navigator === 'undefined') ? true : false;
const userAgent = (isNode) ? 'node' : navigator.userAgent;
const platform = (isNode) ? 'node' : navigator.platform;
export const isElectron = userAgent.includes('Electron');
export const isFirefox = userAgent.includes('Firefox');
export const isLegacyEdge = userAgent.includes('Edge');
export const isSafari = /^((?!chrome|android).)*safari/i.test(userAgent);