-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve platform detection and improve guide for installing other lan…
…guages
- Loading branch information
1 parent
09787d1
commit ef966d7
Showing
2 changed files
with
55 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
export enum BrowserType { | ||
Chrome, | ||
Firefox, | ||
Edge | ||
} | ||
|
||
export const getCurrentBrowser = () => { | ||
if (/Firefox/.test(navigator.userAgent)) { | ||
return BrowserType.Firefox; | ||
} | ||
else if (/Edge/.test(navigator.userAgent)) { | ||
return BrowserType.Edge; | ||
} | ||
else { | ||
return BrowserType.Chrome; | ||
} | ||
} | ||
|
||
export const isWindows = () => { | ||
const windowsPlatforms = /(win32|win64|windows|wince)/i; | ||
return windowsPlatforms.test(globalThis.navigator.userAgent.toLowerCase()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters