Skip to content

Commit

Permalink
Merge pull request #13856 from nextcloud/dependabot/npm_and_yarn/ua-p…
Browse files Browse the repository at this point in the history
…arser-js-2.0.0
  • Loading branch information
Antreesy authored Nov 23, 2024
2 parents db0bb01 + d384677 commit be45de1
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 28 deletions.
110 changes: 89 additions & 21 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"mitt": "^3.0.1",
"mockconsole": "0.0.1",
"pinia": "^2.2.6",
"ua-parser-js": "^1.0.39",
"ua-parser-js": "^2.0.0",
"util": "^0.12.5",
"vue": "^2.7.16",
"vue-cropperjs": "^4.2.0",
Expand All @@ -83,7 +83,6 @@
"@nextcloud/stylelint-config": "^3.0.1",
"@nextcloud/webpack-vue-config": "^6.2.0",
"@types/jest": "^29.5.14",
"@types/ua-parser-js": "^0.7.39",
"@vue/test-utils": "^1.3.6",
"@vue/tsconfig": "^0.5.1",
"@vue/vue2-jest": "^29.2.6",
Expand Down
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 be45de1

Please sign in to comment.