是可能检测三星股票浏览器 [英] Is it possible to detect samsung stock browser
问题描述
因为三星股票浏览器的画布错误,我的程序会导致错误。
( http://code.google.com/p/ android / issues / detail?id = 39247 )
Because the canvas bug of samsung stock browser, my program will cause error. (http://code.google.com/p/android/issues/detail?id=39247)
所以我想禁用所有三星股票浏览器上的画布。
So I want to disable canvas on all Samsung stock browser.
我可以通过导航器对象或其他方式检测吗?
Could I detect it by navigator object or other way?
我发现同样的问题,但它的解决方案看起来不完美
javascript - 用户代理上的正则表达式匹配设备)
I found the same question, but it's solution looks like not perfect (javascript - regex matching devices on user agent)
Wiki显示三星有更多的型号。
( http://en.wikipedia.org/wiki/Samsung_Galaxy_S_III )
Wiki shows Samsung has more models. (http://en.wikipedia.org/wiki/Samsung_Galaxy_S_III)
推荐答案
使用userAgent就足以检测这个bug。查找字符串 534.30
。例如:
using the userAgent is enough to detect this bug. Look for the string 534.30
. For instance:
if (window.navigator && window.navigator.userAgent.indexOf('534.30') > 0) {
// Clear the canvas a different way because they are using a known-bad version of the default android browser
}
这篇关于是可能检测三星股票浏览器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!