Module

utils/env

@ckeditor/ckeditor5-utils/src/env

module

Filtering

Constants

  • env : EnvType

    A namespace containing environment and browser information.

Interfaces

Functions

  • getUserAgent() → string

    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

    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.

  • 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

    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

    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

    Checks if the user agent has enabled a forced colors mode (e.g. Windows High Contrast mode).

    Returns false in environments where window global object is not available.

    Returns

    boolean
  • isMotionReduced() → boolean

    Checks if the user enabled "prefers reduced motion" setting in browser.

    Returns false in environments where window global object is not available.

    Returns

    boolean
  • isRegExpUnicodePropertySupported() → boolean

    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

    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

    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

    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.