Detector

Module for checking if certain features are available, and for getting WebGL context parameters.

Methods

.checkWebGL () : Boolean

Checks if a WebGL context can be obtained.

.checkWorkers () : Boolean

Checks if Worker API is available.

.checkFileAPI () : Object

Returns last API namespace found in the list: File, FileReader, FileList, Blob.

.genWebGLErrorMessage () : HTMLElement

Creates an HTML element with the WebGL non-availability message and the link to the troubleshooting page.

.showWebGLErrorMessage (elem : HTMLElement) : undefined

Generates and shows the WebGL non-availability message by appending it as child to the specified element (or document body if no element is specified).

.checkIOS () : Boolean

Retrieves user agent information and finds if it is running on iPhone, iPad or iPod.

.checkAndroid () : Boolean

Retrieves user agent information and finds if it is running on Android.

.checkHDR (renderer : Object) : Boolean

Checks if both OES_texture_half_float and OES_texture_half_float_linear extensions are offered by the WebGL context.

.getGPUVendor (renderer : Object) : String

Returns the UNMASKED_VENDOR_WEBGL parameter of the WEBGL_debug_renderer_info extension. If the latter is not present, returns empty string value.

.getGPUModel (renderer : Object) : String

Returns the UNMASKED_RENDERER_WEBGL parameter of the WEBGL_debug_renderer_info extension. If the latter is not present, returns empty string value.

Source

For more info on how to obtain the source code of this module see this page.