/
githubmirror
/
angular
Обзор
Документация
Войти
/
githubmirror
/
angular
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
adev/shared-docs/utils/device.utils.ts
25 строк
793 B
Joey Perrott
refactor(docs-infra): migrate @angular/docs from dev-infra into adev directory (#57132)
30 июл 2024, 18:51
30 июл 2024, 18:51
2d8635d
Код
Авторство
О чём код?
/*! * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ export const isMobile = typeof window !== 'undefined' && window.navigator.userAgent.toLowerCase().includes('mobi'); export const isApple = typeof window !== 'undefined' && (/iPad|iPhone/.test(window.navigator.userAgent) || window.navigator.userAgent.includes('Mac')); export const isIpad = typeof window !== 'undefined' && isApple && !!window.navigator.maxTouchPoints && window.navigator.maxTouchPoints > 1; export const isIos = (isMobile && isApple) || isIpad; export const isFirefox = typeof window !== 'undefined' && window.navigator.userAgent.includes('Firefox/');