检测浏览器是否为三星手机 [英] Detect if Browser is Samsung Phone

查看:44
本文介绍了检测浏览器是否为三星手机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人想出一种检测客户端浏览器是否是三星手机的好方法.我特别在寻找三星 S3 和 Note 2,但如果它捕捉到 S2 和 Note 1 或其他三星手机,我可以接受.未来证明的东西(即可能与 S4/Note3 一起工作显然是理想的).

Has anyone figured out a good way to detect if the client's browser is a Samsung phone. I'm specifically looking for Samsung S3 And Note 2, but if it catches S2 and Note 1 or other Samsung phones I can live with that. Something that is future proof (i.e. likely to work with S4 / Note3 is obviously ideal).

似乎没有像 iPhone 那样直接的方法来做到这一点,但对于庞大的 S3 和 Note2 用户群,我们希望为这些设备进行定制.

There seems to be no straight-forward way to do this like there is with iPhones, but with the large S3 and Note2 user base we would like to customize for those devices.

我知道并非所有 S3 都有相同的用户代理(http://stackoverflow.com/questions/11282944/what-is-the-samsung-s3-user-agent)

I'm aware that not all S3's have the same user agent (http://stackoverflow.com/questions/11282944/what-is-the-samsung-s3-user-agent)

如果有人将手机设置为 PC 版本,那么我不希望看到这些(http://stackoverflow.com/questions/11597940/android-phone-browser-detection)

And if someone has set there phone to PC version then I don't expect to catch these (http://stackoverflow.com/questions/11597940/android-phone-browser-detection)

我意识到这可能是一个没有好的解决方案的问题.

I realize this is likely a problem with no good solution.

推荐答案

显然很难检测到只有三星手机,但是如果您查看 此处,然后在您的问题此处,您会注意到用户代理取决于手机型号.

It's obviously very hard to detect only a Samsung phone, but if you check here, and check back to the User Agent question in your question here, you'd notice that the User Agent depends on the phone model.

仅限于GS3,有很多型号,例如GT-I9300[T]、SHV-E210K/L/S、SGH-T999[v]、SGH-I747[m]、SGH-N064(SC-06D)、SCH-R530、SCH-I535、SPH-L710、GT-I9305[T]、GT-I9308

Limiting to just the GS3, there are plenty of model numbers, such as GT-I9300[T], SHV-E210K/L/S, SGH-T999[v], SGH-I747[m], SGH-N064 (SC-06D), SCH-R530, SCH-I535, SPH-L710, GT-I9305[T], GT-I9308

我不是网络开发人员,我不确定您将如何检测用户代理的特定部分,但是如果您可以针对 GS3 的每个型号调整您的代码,我假设这会工作得很好.Note 2的型号也是如此,出来时就是GS4/Note 3.

I'm not a web developer, I'm not sure how you would go about detecting that certain part of the User Agent, but if you can adapt your code for every model of the GS3, I'm assuming that would work well. Same goes with the model numbers of the Note 2, and when they come out, the GS4/Note 3.

这篇关于检测浏览器是否为三星手机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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