Result fields are interpreted as follows:
- featureTestVersion: the version number of this test code itself.
- runDate: local browser time of when the test was run.
- appVersion: passes navigator.appVersion.
- platform: passes navigator.platform.
- userAgent: passes navigator.userAgent.
- From the user agent string, several heuristic guesses are made to deduce human-readable information about the browser. This information is carried in the userAgentExplained object:
- userAgentExplained.platform: Makes a guess of the user's specific hardware platform, e.g. 'PC', 'Mac', 'iPhone', 'iPad', 'Nexus', 'Samsung' and so on.
- userAgentExplained.bitness: Specifies the browser and operating system CPU bit width. This is either 32, 64, or '32-on-64' if running a 32bit browser on a 64bit OS.
- userAgentExplained.arch: Tries to determine the CPU architecture of the current system.
- userAgentExplained.formFactor: One of 'Desktop', 'Mobile', 'Tablet' or 'TV'.
- userAgentExplained.os: Name of the user's operating system (e.g. 'Windows', 'Mac OS', 'Linux', 'Android', 'iOS')
- userAgentExplained.osVersion: Version number or name of the OS.
- userAgentExplained.browserVendor: Name of the company who authored the browser: 'Mozilla', 'Google', 'Microsoft', 'Apple'. Note that this could also be 'Opera' or 'Samsung' for companies who are distributing variants of Chrome. See the userAgentExplained.productComponents field if there is a need to distinguish Chromium-based browsers specifically.
- userAgentExplained.browserProduct: Marketing name for the browser: 'Firefox', 'Edge', 'Internet Explorer', 'Safari', 'Chrome', ...
- userAgentExplained.productComponents: A tokenized array of product name, version pairs which determine the compatibility of the browser.
- vendor: passes navigator.vendor.
- vendorSub: passes navigator.vendorSub.
- product: passes navigator.product.
- productSub: passes navigator.productSub.
- language: passes navigator.language.
- appCodeName: passes navigator.appCodeName.
- appName: passes navigator.appName.
- maxTouchPoints: passes navigator.maxTouchPoints.
- pointerEnabled: passes navigator.pointerEnabled.
- cpuClass: passes navigator.cpuClass.
- contiguousSystemMemory: The maximum amount of memory that JavaScript code is able to allocate in one contiguous block, in bytes. The maximum contiguous allocation size is 2GB.
- displayRefreshRate: measures the rate at which the requestAnimationFrame() callbacks ticks forward, i.e. the vsync rate of the display.
- windowDevicePixelRatio: passes window.devicePixelRatio.
- screenWidth: passes screen.width. This is the pixel width of the display in logical CSS pixel units.
- screenHeight: passes screen.height. This is the pixel height of the display in logical CSS pixel units.
- physicalScreenWidth: computes the actual display pixel width in hardware pixels.
- physicalScreenHeight: computes the actual display pixel height in hardware pixels.
- hardwareConcurrency: passes navigator.hardwareConcurrency. If this is not supported, '0' is returned here.
- singleCoreMips: measures the single core clock speed of the processor, in fictional performance units.
- webGLSupport: Enumerates the support status of WebGL 1 and WebGL 2 and software vs hardware acceleration support. If some of these are not supported, this object specifies the error reasons.
- supportedApis: lists the various Web APIs that are supported by the browser.
- unsupportedApis: lists all the remaining Web APIs that were tested for, but support is not present.
- canonicalizesNansInsideAsmModule: tests whether the browser is able to carry payload data in floating point NaN values inside an asm.js module.
- canonicalizesNansOutsideAsmModule: tests whether the browser is able to carry payload data in floating point NaN values in regular handwritten JavaScript code.
- canonicalF32NanValueInsideAsmModule: specifies the bit pattern of the canonical single-precision floating point NaN value inside an asm.js module.
- canonicalF32NanValueOutsideAsmModule: specifies the bit pattern of the canonical single-precision floating point NaN value in regular handwritten JavaScript code.
- canonicalF64NanValueInsideAsmModule: specifies the bit pattern of the canonical double-precision floating point NaN value inside an asm.js module.
- canonicalF64NanValueOutsideAsmModule: specifies the bit pattern of the canonical double-precision floating point NaN value in regular handwritten JavaScript code.
- typedArrayEndianness: Either 'little endian' or 'big endian', depending on the endianness of the target hardware. Most likely (x86, Android & iOS ARM) this is 'little endian'.
- GL_VENDOR: passes WebGL GL_VENDOR string from the highest supported version of the WebGL context.
- GL_RENDERER: passes WebGL GL_RENDERER string from the highest supported version of the WebGL context.
- GL_VERSION: passes WebGL GL_VERSION string from the highest supported version of the WebGL context.
- GL_SHADING_LANGUAGE_VERSION: passes WebGL GL_SHADING_LANGUAGE_VERSION string from the highest supported version of the WebGL context.
- GL_UNMASKED_VENDOR_WEBGL: passes WebGL GL_UNMASKED_VENDOR_WEBGL string from the highest supported version of the WebGL context. This requires the WebGL extension WEBGL_debug_renderer_info to be supported.
- GL_UNMASKED_RENDERER_WEBGL: passes WebGL GL_UNMASKED_RENDERER_WEBGL string from the highest supported version of the WebGL context. This requires the WebGL extension WEBGL_debug_renderer_info to be supported.
- supportedWebGLExtensions: lists the different WebGL extensions that are available in the highest supported version of the WebGL context.
Usage
To incorporate the feature tests to your own code, copy over featuretest.js from this repository and call the browserFeatureTest function as shown in the code snippet below. See the page source of this .html file for a complete example.
<html>
<body>
<script src="featuretest.js"></script>
<script>
function onFeatureTestComplete(results) {
// Example: how to test for the presence of a certain API
if (results.supportedApis.indexOf('IndexedDB') != -1) console.log('IndexedDB is supported!');
// Example: how to find if WebGL comes without a performance caveat.
if (results.webGLSupport.webgl1.supported && !results.webGLSupport.webgl1.performanceCaveat) console.log('Hardware-accelerated WebGL is supported!');
// Example: dump all results as a whitespace-readable JSON string.
console.log(JSON.stringify(results, null, 2));
}
browserFeatureTest(onFeatureTestComplete);
</script>
</body>
</html>