Can Samsung stock browser be detected?

Due to a canvas error in the samsung browser browser, my program will cause an error. ( http://code.google.com/p/android/issues/detail?id=39247 )

So, I want to disable the canvas in all Samsung browsers.

Can I detect it using a navigation object or in another way?

I found the same question, but this solution does not look perfect ( javascript - suitable for regexing devices in user agent )

The wiki shows that Samsung has more models. ( http://en.wikipedia.org/wiki/Samsung_Galaxy_S_III )

+6
source share
4 answers

You can just do it

var isSamsungBrowser = navigator.userAgent.match(/SamsungBrowser/i) 
+3
source

using userAgent is enough to detect this error. Find line 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 } 
0
source

Some Samsung user agents have the word "samsung" in them. If you find “samsung” in the user agent string, this is a good indicator. However, most Samsung user agents that I looked at did not contain the word samsung. But there is another check, all samsung model numbers (so far) are in the format "GT-xxxxxx", so we check if the user has the agent "android", and then "GT-" somewhere in UA. (or the word samsung ...) This is obviously a little weaker, but it seems they still like it.

0
source

The following regex covers almost all Samsung mobile devices.

 if(navigator.userAgent.match(/SAMSUNG|Samsung|SGH-[I|N|T]|GT-[I|N]|SM-[N|P|T|Z]|SHV-E|SCH-[I|J|R|S]|SPH-L/i)) { console.log("it Samsung"); // your code for samsung goes here ... } 
0
source

All Articles