forked from medusajs/medusa
-
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.
docs: handle step tooltip bug in safari (medusajs#10954)
- Loading branch information
1 parent
fa5d1b6
commit cf62a0a
Showing
4 changed files
with
54 additions
and
12 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
This file was deleted.
Oops, something went wrong.
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
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,39 @@ | ||
export function getBrowser(): | ||
| "Chrome" | ||
| "Safari" | ||
| "Firefox" | ||
| "Internet Explorer" | ||
| "Edge" | ||
| "unknown" { | ||
if (typeof navigator === "undefined") { | ||
return "unknown" | ||
} | ||
|
||
const userAgent = navigator.userAgent.toLowerCase() | ||
|
||
if (userAgent.indexOf("chrome") > -1) { | ||
return "Chrome" | ||
} else if (userAgent.indexOf("safari") > -1) { | ||
return "Safari" | ||
} else if (userAgent.indexOf("firefox") > -1) { | ||
return "Firefox" | ||
} else if ( | ||
userAgent.indexOf("msie") > -1 || | ||
userAgent.indexOf("trident") > -1 | ||
) { | ||
return "Internet Explorer" | ||
} else if (userAgent.indexOf("edge") > -1) { | ||
return "Edge" | ||
} else { | ||
return "unknown" | ||
} | ||
} | ||
|
||
export function getOsShortcut() { | ||
const isMacOs = | ||
typeof navigator !== "undefined" | ||
? navigator.userAgent.toLowerCase().indexOf("mac") !== 0 | ||
: true | ||
|
||
return isMacOs ? "⌘" : "Ctrl" | ||
} |