Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add WebGL detection (available in new plugin DeviceFeatureWebGL) #10841

Closed
johsin18 opened this issue Nov 6, 2016 · 4 comments
Closed

Add WebGL detection (available in new plugin DeviceFeatureWebGL) #10841

johsin18 opened this issue Nov 6, 2016 · 4 comments
Assignees
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.

Comments

@johsin18
Copy link
Contributor

johsin18 commented Nov 6, 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
Copy link
Member

sgiehl commented Nov 6, 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
Copy link
Member

tsteur commented Nov 7, 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
Copy link
Member

tsteur commented Nov 7, 2016

Especially for tracker...

@mattab mattab added the Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. label Nov 11, 2016
@mattab mattab added this to the 3.0.0 milestone Nov 11, 2016
@sgiehl sgiehl self-assigned this May 30, 2017
@sgiehl
Copy link
Member

sgiehl commented Jul 5, 2017

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

@sgiehl sgiehl closed this as completed Jul 5, 2017
@mattab mattab changed the title Add WebGL support statistics Add WebGL detection (available in new plugin DeviceFeatureWebGL) Sep 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.
Projects
None yet
Development

No branches or pull requests

4 participants