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?
I found the same question, but it's solution looks like not perfect (javascript - regex matching devices on user agent)
Wiki shows Samsung has more models. (http://en.wikipedia.org/wiki/Samsung_Galaxy_S_III)
The following regex covers almost all Samsung mobile devices.
if(navigator.userAgent.match(/SAMSUNG|Samsung|SGH-[I|N|T]|GT-[I|N]|SM-[A|N|P|T|Z]|SHV-E|SCH-[I|J|R|S]|SPH-L/i)) {
console.log("it's Samsung");
// your code for Samsung Smartphones goes here...
}
You can simply do this
var isSamsungBrowser = navigator.userAgent.match(/SamsungBrowser/i)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With