Skip to content

Commit

Permalink
fix(ua-parser): migrate to 2.0
Browse files Browse the repository at this point in the history
Signed-off-by: Maksim Sukharev <[email protected]>
  • Loading branch information
Antreesy committed Nov 23, 2024
1 parent 907272c commit e1beff3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/utils/browserCheck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

import UAParser from 'ua-parser-js'
import { UAParser } from 'ua-parser-js'

import { showError, TOAST_PERMANENT_TIMEOUT } from '@nextcloud/dialogs'
import { t } from '@nextcloud/l10n'
Expand All @@ -16,22 +16,22 @@ const os = parser.getOS()
* Per-OS flags
*/

export const isMac = os.name === 'Mac OS'
export const isMac = os.name === 'macOS'

/**
* Per-browser flags and a major version
*/

export const isFirefox = browser.name === 'Firefox'
export const isChrome = browser.name === 'Chrome' || browser.name === 'Chromium'
export const isFirefox = browser.name === 'Firefox' || browser.name === 'Mobile Firefox'
export const isChrome = browser.name === 'Chrome' || browser.name === 'Chromium' || browser.name === 'Mobile Chrome'
export const isOpera = browser.name === 'Opera'
export const isSafari = browser.name === 'Safari' || browser.name === 'Mobile Safari'
export const isEdge = browser.name === 'Edge'
export const isBrave = browser.name === 'Brave'
export const isIE = browser.name === 'IE' || browser.name === 'IEMobile'
export const isYandex = browser.name === 'Yandex'

export const majorVersion = browser.version ? parseInt(browser.version.split('.')[0], 10) : 0
export const majorVersion = browser.major ? parseInt(browser.major, 10) : 0

/**
* Is the browser Chromium-based
Expand Down

0 comments on commit e1beff3

Please sign in to comment.