Capabilities [mwf.capability]

Description

The mwf.capability object provides telemetry about device abilities through active polling.

Internally, this object leverages Modernizr. However, this is not guaranteed to always be the case and users are encouraged to always use the MWF namespace documented below rather than to leverage side effects of the use of Modernizr. Modernizr is not used directly because MWF seeks to potentially provide a wider range of telemetry such as whether cookie writing is allowed and whether AJAX is available.

Functions & Properties

Current (MWF 1.2)

The following functions are available through mwf.capability:

  • mwf.capability.ajax() True if the device supports AJAX through XMLHttpRequest or ActiveXObject.

  • mwf.capability.applicationcache() True if the device supports application cache [WHATWG Web Applications 1.0 Sec 6.6].

  • mwf.capability.audio() True if the device supports the HTML 5 audio tag [HTML 5 Sec 4.8.7].

  • mwf.capability.canvas() True if the device supports the HTML 5 canvas element [HTML 5 Sec 4.8.11].

  • mwf.capability.cookie() True if the device supports cookies through document.cookie.

  • mwf.capability.css.borderradius() True if the device supports border-radius (or vendor prefixed) rule [CSS Backgrounds and Borders Module Level 3 Sec 5].

  • mwf.capability.css.boxshadow() True if the device supports the box-shadow (or vendor prefixed) rule [CSS Backgrounds and Borders Module Level 3 Sec 7.2].

  • mwf.capability.css.fontface() True if the device supports the @font-face rule [CSS Fonts Module Level 3 Sec 4.1].

  • mwf.capability.css.gradients() True if the device supports the gradients (or vendor prefixed) property [CSS Image Values and Replaced Content Module Level 3 Sec 5].

  • mwf.capability.css.prop(prop) True if the property string provided as a parameter is available for the device.

  • mwf.capability.css.transforms() True if both mwf.capability.css.transforms2d() and mwf.capability.css.transforms3d().

  • mwf.capability.css.transforms2d() True if device supports CSS 3 2D transform (or vendor prefixed) properties [CSS 2D Transforms Module Level 3].

  • mwf.capability.css.transforms3d() True if device supports CSS 3 3D transform (or vendor prefixed) properties [CSS 3D Transforms Module Level 3].

  • mwf.capability.css.transitions() True if device supports CSS 3 transition (or vendor prefixed) properties [CSS Transitions Module Level 3].

  • mwf.capability.css3() True if device has minimal standardized CSS 3 support (as full browser) with border radius, box shadow and gradients.

  • mwf.capability.draganddrop() True if device supports HTML 5 drag and drop [HTML 5 Sec 7.7].

  • mwf.capability.events() True if device supports addEventListener. Even if false, DOM may still support onEvent element attributes.

  • mwf.capability.event(eventName) True if device supports the event given by eventName.

  • mwf.capability.flexbox() True if device supports the enhanced flexible box model.

  • mwf.capability.inlinesvg() True if device supports SVG specified inline.

  • mwf.capability.localstorage() True if device supports local storage under HTML 5 Web Storage API.

  • mwf.capability.sessionstorage() True if device supports session storage under HTML 5 Web Storage API.

  • mwf.capability.svg() True if device supports SVG.

  • mwf.capability.touch() True if device has touch interface.

  • mwf.capability.video() True if the device supports the HTML 5 video tag [HTML 5 Sec 4.8.6].

  • mwf.capability.webgl() True if the device supports WebGL.

  • mwf.capability.websockets() True if the device supports WebSocket API.

  • mwf.capability.write() True if the device supports DOM writes.

Previous (MWF 1.0-1.1)

This object did not exist before MWF 1.2.