Interface nsIScreenType

Hierarchy

Properties

colorDepth: number
colorGamut: ScreenColorGamut

ScreenColorGamut is native type, which cannot be declared [infallible].

contentsScaleFactor: number

The number of device pixels per desktop pixel for this screen (for hidpi configurations where there may be multiple device pixels per desktop px and/or per CSS px).

This seems poorly named (something like devicePixelsPerDesktopPixel would be more accurate/explicit), but given that it is exposed to front-end code and may also be used by add-ons, it's probably not worth the disruption of changing it.

Returns 1.0 if HiDPI mode is disabled or unsupported, or if the host OS uses device pixels as its desktop pixel units (e.g. Windows 7 or GTK/X11). Per-monitor DPI is available in Windows 8.1+, GTK/Wayland or macOS.

defaultCSSScaleFactor: number

The default number of device pixels per unscaled CSS pixel for this screen. This is probably what contentsScaleFactor originally meant to be, prior to confusion between CSS pixels and desktop pixel units.

dpi: number

The DPI of the screen.

isPseudoDisplay: boolean
pixelDepth: number
refreshRate: number

The target screen refresh rate, in Hz, or 0 if unknown

Methods

  • Increases the reference count for this interface. The associated instance will not be deleted unless the reference count is returned to zero.

    Returns

    The resulting reference count.

    Returns number

  • Parameters

    • left: number
    • top: number
    • width: number
    • height: number

    Returns void

  • Parameters

    • left: number
    • top: number
    • width: number
    • height: number

    Returns void

  • These report screen dimensions in (screen-specific) device pixels

    Parameters

    • left: number
    • top: number
    • width: number
    • height: number

    Returns void

  • And these report in desktop pixels

    Parameters

    • left: number
    • top: number
    • width: number
    • height: number

    Returns void

  • Parameters

    • aIID: object
    • Optional aInstancePtr: object

    Returns any

  • A run time mechanism for interface discovery.

    Returns

    NS_OK if the interface is supported by the associated instance, NS_NOINTERFACE if it is not.

    aInstancePtr must not be null.

    Parameters

    • aIID: object

      [in] A requested interface IID

    • aInstancePtr: object

      [out] A pointer to an interface pointer to receive the result.

    Returns void

  • Decreases the reference count for this interface. Generally, if the reference count returns to zero, the associated instance is deleted.

    Returns

    The resulting reference count.

    Returns number

Generated using TypeDoc