Detector

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

Methods

.checkWebGL() → Boolean

Checks if a WebGL 1.0 context can be obtained.

.checkWebGL2() → Boolean

Checks if a WebGL 2.0 context can be obtained.

.checkWorkers() → Boolean

Checks if Web Workers 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)

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.

.checkFloatTex(renderer : WebGLRenderer, requireLinear : Boolean) → Boolean

Check if float textures are available for rendering.

.checkHalfFloatTex(renderer : WebGLRenderer, requireLinear : Boolean) → Boolean

Check if half-float textures are available for rendering.

.checkHalfFloatReadPixels(renderer : WebGLRenderer) → Boolean

Check if you can read pixels from half-float render target.

.checkFloatReadPixels(renderer : WebGLRenderer) → Boolean

Check if you can read pixels from float render target.

.checkDepthTex(renderer : WebGLRenderer) → Boolean

Check if depth textures are available for rendering.

.getGPUVendor(renderer : WebGLRenderer) → 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 : WebGLRenderer) → String

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

.checkWebXR() → Boolean

Check if WebXR API (VR) API is available.

.checkSwiftShader(renderer : WebGLRenderer) → Boolean

Check if only Swift Shader software rasterizer is available for rendering.

.checkWebAudio() → Boolean

Check if WebAudio API is available.

.checkTouchDevice() → Boolean

Check if touch device is available.

Puzzles

The feature available and get GPU puzzles allow to access most of these methods without coding.

Source

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