Browser
The Browser object of the BrowserManager class provides methods for determining the type of browser, Internet Explorer version, operating system, and other device characteristics such as touch input support and screen resolution.
import { Browser, LoggerBrowser } from '@bitrix24/b24jssdk'
const $logger = LoggerBrowser.build('Test', import.meta.env?.DEV === true)
$logger.info('isTouchDevice:', Browser.isTouchDevice())
// isTouchDevice: false ////It uses
navigator.userAgentto determine browser and device characteristics.
Methods
isOpera
isOpera(): booleanReturns true if the current browser is Opera.
isIE
isIE(): booleanReturns true if the current browser is Internet Explorer.
isIE6
isIE6(): booleanReturns true if the current browser is Internet Explorer version 6.
isIE7
isIE7(): booleanReturns true if the current browser is Internet Explorer version 7.
isIE8
isIE8(): booleanReturns true if the current browser is Internet Explorer version 8.
isIE9
isIE9(): booleanReturns true if the current browser is Internet Explorer version 9.
isIE10
isIE10(): booleanReturns true if the current browser is Internet Explorer version 10.
isSafari
isSafari(): booleanReturns true if the current browser is Safari.
isFirefox
isFirefox(): booleanReturns true if the current browser is Firefox.
isChrome
isChrome(): booleanReturns true if the current browser is Chrome.
detectIEVersion
detectIEVersion(): numberReturns the version of Internet Explorer or -1 if the browser is not IE.
isIE11
isIE11(): booleanReturns true if the current browser is Internet Explorer version 11.
isMac
isMac(): booleanReturns true if the operating system is MacOS.
isWin
isWin(): booleanReturns true if the operating system is Windows.
isLinux
isLinux(): booleanReturns true if the operating system is Linux and not Android.
isAndroid
isAndroid(): booleanReturns true if the device is running on Android.
isIPad
isIPad(): booleanReturns true if the device is an iPad.
isIPhone
isIPhone(): booleanReturns true if the device is an iPhone.
isIOS
isIOS(): booleanReturns true if the device is running on iOS (iPad or iPhone).
isMobile
isMobile(): booleanReturns true if the device is mobile.
isRetina
isRetina(): booleanReturns true if the device has a Retina display.
isTouchDevice
isTouchDevice(): booleanReturns true if the device supports touch input.
isDoctype
isDoctype(target: any): booleanReturns true if the document has a CSS1Compat compatibility mode.
isLocalStorageSupported
isLocalStorageSupported(): booleanReturns true if local storage is supported and available.
detectAndroidVersion
detectAndroidVersion(): numberReturns the version of Android or 0 if the device is not Android.