@johsin18 opened this issue on November 6th 2016

Would be great if Piwik would report statistics on WebGL support, maybe as one more entry in the list of "Plugins" in the Visitors/Software page. It's not literally a plugin, but "Cookie" is neither, and WebGL is often used as a replacement for some of the listed plugins, e.g. Flash.

@sgiehl commented on November 6th 2016

I'd vote to implement that in Piwik 3. Shouldn't be difficult to detect. Sample JS to do it proper:

var canvas = document.createElement('canvas');
var webglContextParams = ['webgl', 'experimental-webgl', 'webkit-3d', 'moz-webgl'];
var webglContext = null;
for (var index = 0; index < webglContextParams.length; index++) {
    try {
        webglContext = canvas.getContext(webglContextParams[index]);
        if(webglContext) {
            break;
        }
    } catch (e) {}
}
if(webglContext === null) {
    console.log('WebGL is not supported');
} else {
    console.log('WebGL is supported');
}

Note: Not sure if we should make that detection by default. Creating WebGL objects might force the browser switching from Hardware- to Software-Rendering. At least IE makes that afaik.

@tsteur commented on November 7th 2016

When we're unsure about certain features it is always good to add the feature as opt-in 👍 and once we have more experience with it and feedback make it default eg in Piwik 4

@tsteur commented on November 7th 2016

Especially for tracker...

@sgiehl commented on July 5th 2017

release in a new plugin: https://plugins.piwik.org/DeviceFeatureWebGL Will work from the next release on

This issue was closed on July 5th 2017
Powered by GitHub Issue Mirror