utils/env
Constants
-
module:utils/env~env
A namespace containing environment and browser information.
Interfaces
-
module:utils/env~EnvFeaturesType
-
module:utils/env~EnvType
Functions
-
getUserAgent() → string
internalmodule:utils/env~getUserAgent
Safely returns
userAgent
from browser's navigator API in a lower case. If navigator API is not available it will return an empty string.Returns
string
-
isAndroid( userAgent ) → boolean
internalmodule:utils/env~isAndroid
Checks if User Agent represented by the string is Android mobile device.
Parameters
userAgent : string
Lowercase
navigator.userAgent
string.
Returns
boolean
Whether User Agent is Safari or not.
-
isBlink( userAgent ) → boolean
internalmodule:utils/env~isBlink
Checks if User Agent represented by the string is Blink engine.
Parameters
userAgent : string
Lowercase
navigator.userAgent
string.
Returns
boolean
Whether User Agent is Blink engine or not.
-
isGecko( userAgent ) → boolean
internalmodule:utils/env~isGecko
Checks if User Agent represented by the string is Firefox (Gecko).
Parameters
userAgent : string
Lowercase
navigator.userAgent
string.
Returns
boolean
Whether User Agent is Firefox or not.
-
isMac( userAgent ) → boolean
internalmodule:utils/env~isMac
Checks if User Agent represented by the string is running on Macintosh.
Parameters
userAgent : string
Lowercase
navigator.userAgent
string.
Returns
boolean
Whether User Agent is running on Macintosh or not.
-
isMediaForcedColors() → boolean
internalmodule:utils/env~isMediaForcedColors
Checks if the user agent has enabled a forced colors mode (e.g. Windows High Contrast mode).
Returns
false
in environments wherewindow
global object is not available.Returns
boolean
-
isMotionReduced() → boolean
internalmodule:utils/env~isMotionReduced
Checks if the user enabled "prefers reduced motion" setting in browser.
Returns
false
in environments wherewindow
global object is not available.Returns
boolean
-
isRegExpUnicodePropertySupported() → boolean
internalmodule:utils/env~isRegExpUnicodePropertySupported
Checks 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 ) → boolean
internalmodule:utils/env~isSafari
Checks if User Agent represented by the string is Safari.
Parameters
userAgent : string
Lowercase
navigator.userAgent
string.
Returns
boolean
Whether User Agent is Safari or not.
-
isWindows( userAgent ) → boolean
internalmodule:utils/env~isWindows
Checks if User Agent represented by the string is running on Windows.
Parameters
userAgent : string
Lowercase
navigator.userAgent
string.
Returns
boolean
Whether User Agent is running on Windows or not.
-
isiOS( userAgent ) → boolean
internalmodule:utils/env~isiOS
Checks if User Agent represented by the string is running in iOS.
Parameters
userAgent : string
Lowercase
navigator.userAgent
string.
Returns
boolean
Whether User Agent is running in iOS or not.