This repository has been archived by the owner on Feb 5, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: hide audio interface for non chrome browsers (COR-000) (#187)
- Loading branch information
Showing
4 changed files
with
30 additions
and
8 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 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
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,23 @@ | ||
import { DEVICE_INFO } from '@/constants'; | ||
|
||
export const isIOS = () => DEVICE_INFO.os.name === 'iOS'; | ||
|
||
export const isBrave = () => { | ||
const browserNavigator = globalThis.navigator as Navigator & { brave?: { isBrave: () => boolean } }; | ||
|
||
if (!browserNavigator) return false; | ||
|
||
if (browserNavigator.brave !== undefined) { | ||
return browserNavigator.brave.isBrave.name === 'isBrave'; | ||
} | ||
|
||
return false; | ||
}; | ||
|
||
export const isArc = () => !!getComputedStyle(document.documentElement).getPropertyValue('--arc-palette-title'); | ||
export const isEdge = () => DEVICE_INFO.browser.name === 'Microsoft Edge'; | ||
export const isOpera = () => DEVICE_INFO.browser.name === 'Opera'; | ||
export const isChrome = () => !isBrave() && !isArc() && DEVICE_INFO.browser.name === 'Chrome'; | ||
export const isSafari = () => DEVICE_INFO.browser.name === 'Safari'; | ||
export const isFirefox = () => DEVICE_INFO.browser.name === 'Firefox'; | ||
export const isChromium = () => isEdge() || isChrome() || isBrave() || isArc() || isOpera(); |