Options
All
  • Public
  • Public/Protected
  • All
Menu

The object with functionality related to the browser environment, such as information about the current browser.

Index

Variables

browser

browser: string

The current browser type.

ios

ios: boolean

true if the current browser is an IOS browser, false otherwise.

mobile

mobile: boolean

true if the current browser is a mobile browser, false otherwise.

preferredColorSchemeDark

preferredColorSchemeDark: boolean

true if the user's current OS setting prefers dark mode, false otherwise.

preferredColorSchemeLight

preferredColorSchemeLight: boolean

true if the user's current OS setting prefers light mode, false otherwise.

touch

touch: boolean

true if the current browser supports touch, false otherwise.

Functions

evaluateMediaQuery

  • evaluateMediaQuery(mediaquery: string): boolean
  • Evaluate a media query and return true/false if its a match.

    Parameters

    • mediaquery: string

      the media query to evaluate

    Returns boolean

    true if it matches the query false if not

getOSPreferredColorScheme

  • getOSPreferredColorScheme(): string
  • Gets the user's preferred color scheme set in their operating system.

    Returns string

    either 'dark' or 'light'

getTheme

  • getTheme(): string
  • Gets the currently loaded PrimeFaces theme.

    Returns string

    The current theme, such as omega or luna-amber. Empty string when no theme is loaded.

getThemeContrast

  • getThemeContrast(): string
  • Based on the current PrimeFaces theme determine if light or dark contrast is being applied.

    Returns string

    either 'dark' or 'light'

init

  • init(): void
  • Initializes the environment by reading the browser environment.

    Returns void

isIE

  • isIE(version?: 2 | 7 | 1 | 4 | 3 | 5 | 6 | 8 | 9 | 10 | 11): boolean
  • Checks whether the current browser is the Internet Explorer, and optionally also whether it is a certain version of Internet Explorer.

    Parameters

    • Optional version: 2 | 7 | 1 | 4 | 3 | 5 | 6 | 8 | 9 | 10 | 11

      Version of IE to check for. If not given, checks for any version of Internet Explorer.

    Returns boolean

    true if the current browser is the given version Internet Explorer, or false otherwise.

isLtIE

  • isLtIE(version: 2 | 7 | 1 | 4 | 3 | 5 | 6 | 8 | 9 | 10 | 11): boolean
  • Checks whether the current browser is the Internet Explorer, and whether its version is less than the given version.

    Parameters

    • version: 2 | 7 | 1 | 4 | 3 | 5 | 6 | 8 | 9 | 10 | 11

      Version of IE to check for. If not given, checks for any version of Internet Explorer.

    Returns boolean

    true if the current browser is the Internet Explorer and its version is less than the given version.

isScreenSizeGreaterThan

  • isScreenSizeGreaterThan(pixels: number): boolean
  • Media query to determine if screen size is above pixel count.

    Parameters

    • pixels: number

      the number of pixels to check

    Returns boolean

    true if screen is greater than number of pixels

isScreenSizeLessThan

  • isScreenSizeLessThan(pixels: number): boolean
  • Media query to determine if screen size is below pixel count.

    Parameters

    • pixels: number

      the number of pixels to check

    Returns boolean

    true if screen is less than number of pixels

isTouchable

  • A widget is touch enabled if the browser supports touch AND the widget has the touchable property enabled. The default will be true if it widget status can't be determined.

    Parameters

    Returns boolean

    true if touch is enabled, false if disabled

Generated using TypeDoc