Skip to content

Commit

Permalink
Merge pull request #153 from fingerprintjs/edge
Browse files Browse the repository at this point in the history
Add Edge browser kind
  • Loading branch information
xnerhu authored Nov 6, 2023
2 parents a14abba + 15b0c40 commit 56676ef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,4 +170,5 @@ export const enum BrowserKind {
Safari = 'safari',
IE = 'internet_explorer',
WeChat = 'wechat',
Edge = 'edge',
}
4 changes: 3 additions & 1 deletion src/utils/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ export function getBrowserEngineKind(): BrowserEngineKind {

export function getBrowserKind(): BrowserKind {
const userAgent = navigator.userAgent?.toLowerCase()
if (strIncludes(userAgent, 'safari')) {
if (strIncludes(userAgent, 'edg/')) {
return BrowserKind.Edge
} else if (strIncludes(userAgent, 'safari')) {
return BrowserKind.Safari
} else if (strIncludes(userAgent, 'trident') || strIncludes(userAgent, 'msie')) {
return BrowserKind.IE
Expand Down

0 comments on commit 56676ef

Please sign in to comment.