实际不支持WebGL时,将其检测为受支持 [英] WebGL detected as supported when it is actually not

查看:240
本文介绍了实际不支持WebGL时,将其检测为受支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从Android中的WebView使用WebGL.为了检测是否支持WebGL,我正在使用此功能.

I am using WebGL from a WebView in Android. For detecting whether WebGL is supported or not, I am using this function.

Android KitKat设备未启用WebGL支持,如在各处所述.但是,在我的4.4.2测试设备中,检测功能返回true,并且在调用 http://webglreport.com 从WebView中也可以看到支持WebGL1.

Android KitKat devices do not have WebGL support enabled, as mentioned everywhere. However, in my 4.4.2 test device, the detection function is returning true, and when invoking http://webglreport.com from a WebView it also says WebGL1 is supported.

不足为奇的是,没有任何东西呈现出来.因此,如果WebGL无法正常工作,我想避免使用网页的WebGL版本.

Unsurprisingly, nothing gets rendered. So I would like to avoid using the WebGL version of the page if WebGL is not going to work.

有什么方法可以更好地检测WebGL吗?还是我应该说如果Android< 5,甚至不要尝试检查是否支持WebGL,因为它可能存在".

Is there any way I could detect better for webGL? Or should I just say "if Android < 5, don't even try to check whether WebGL is supported, as it may lie".

推荐答案

我在Android设备上也有类似的经历.通过将Android浏览器列入黑名单来解决(如果我理解正确,还可以将网页视图存储在黑名单中).更新的Chrome通常可以正常运行.

I've had similar experiences with Android devices. Solved by blacklisting Android browser (and, if I understand correctly, stock web view as well). Updated Chrome usually works fine.

这篇关于实际不支持WebGL时,将其检测为受支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆