utils/env
Constants
module:utils/env~envA namespace containing environment and browser information.
Interfaces
module:utils/env~EnvFeaturesTypemodule:utils/env~EnvType
Functions
getUserAgent() → stringinternalmodule:utils/env~getUserAgentSafely returns
userAgentfrom browser's navigator API in a lower case. If navigator API is not available it will return an empty string.Returns
string
isAndroid( userAgent ) → booleaninternalmodule:utils/env~isAndroidChecks if User Agent represented by the string is Android mobile device.
Parameters
userAgent : stringLowercase
navigator.userAgentstring.
Returns
booleanWhether User Agent is Safari or not.
isBlink( userAgent ) → booleaninternalmodule:utils/env~isBlinkChecks if User Agent represented by the string is Blink engine.
Parameters
userAgent : stringLowercase
navigator.userAgentstring.
Returns
booleanWhether User Agent is Blink engine or not.
isGecko( userAgent ) → booleaninternalmodule:utils/env~isGeckoChecks if User Agent represented by the string is Firefox (Gecko).
Parameters
userAgent : stringLowercase
navigator.userAgentstring.
Returns
booleanWhether User Agent is Firefox or not.
isMac( userAgent ) → booleaninternalmodule:utils/env~isMacChecks if User Agent represented by the string is running on Macintosh.
Parameters
userAgent : stringLowercase
navigator.userAgentstring.
Returns
booleanWhether User Agent is running on Macintosh or not.
isMediaForcedColors() → booleaninternalmodule:utils/env~isMediaForcedColorsChecks if the user agent has enabled a forced colors mode (e.g. Windows High Contrast mode).
Returns
falsein environments wherewindowglobal object is not available.Returns
boolean
isMotionReduced() → booleaninternalmodule:utils/env~isMotionReducedChecks if the user enabled "prefers reduced motion" setting in browser.
Returns
falsein environments wherewindowglobal object is not available.Returns
boolean
isRegExpUnicodePropertySupported() → booleaninternalmodule:utils/env~isRegExpUnicodePropertySupportedChecks if the current environment supports ES2018 Unicode properties like
\p{P}or\p{L}. More information about unicode properties might be found in Unicode Standard Annex #44.Returns
boolean
isSafari( userAgent ) → booleaninternalmodule:utils/env~isSafariChecks if User Agent represented by the string is Safari.
Parameters
userAgent : stringLowercase
navigator.userAgentstring.
Returns
booleanWhether User Agent is Safari or not.
isWindows( userAgent ) → booleaninternalmodule:utils/env~isWindowsChecks if User Agent represented by the string is running on Windows.
Parameters
userAgent : stringLowercase
navigator.userAgentstring.
Returns
booleanWhether User Agent is running on Windows or not.
isiOS( userAgent ) → booleaninternalmodule:utils/env~isiOSChecks if User Agent represented by the string is running in iOS.
Parameters
userAgent : stringLowercase
navigator.userAgentstring.
Returns
booleanWhether User Agent is running in iOS or not.