detecting webgl capabilities of the client - webgl

How can I guess what kind of a machine i'm dealing with when running webgl?
Could I query something like MAX_VERTEX_ATTRIBUTES, OES_texture_float and other such properties and guess if it's a more high end or lower end GPU?

I think a better way would be looking at user agent string (navigator.userAgent), WEBGL_UNMASKED_VENDOR and WEBGL_UNMASKED_RENDERER from WEBGL_debug_renderer_info to try to figure out user's platform (mobile or desktop) and GPU (from WEBGL_UNMASKED_RENDERER).
E.g., here's my UA and renderer name:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/10.1 Safari/603.1.30
Intel Iris OpenGL Engine
From that you can guess that I'm running a desktop Mac (Intel Mac part of UA) that has Intel iGPU (from renderer).
Another example, from an iPhone:
Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_2 like Mac OS X) AppleWebKit/603.2.4 (KHTML, like Gecko) Version/10.0 Mobile/14F89 Safari/602.1
Apple A9 GPU
From that you obviously can detect, that you're dealing with an iPhone 6S (since it has A9 chip).
Similarly you can detect Androids and WinPhones and query GPUs.

Related

How does iPad OS determine what is a desktop site in iOS 13 safari

In WWDC 2019 this year Apple stated that safari on the iPad will render a site in desktop. Is there any information or does anyone know how this will work?
As far as I know this will be based on user agents.
iPads will start identifying themselves as Macs
From this….
Mozilla/5.0(iPad; U; CPU iPhone OS 3_2 like Mac OS X; en-us)
AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B314
Safari/531.21.10
To this…
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15) AppleWebKit/605.1.15
(KHTML, like Gecko) Version/13.0 Safari/605.1.15

What is the user agent string for iOS / MacOS iMessage?

I'm parsing s3 logs to identify requests made from iMessage previews (on Mac OS Sierra & iOS 10).
There are few common types of UA strings, but I can't tell which are from the browser vs. imessage. I'm hoping it's a unique UA from Safari:
`AppleCoreMedia/1.0.0.14B100 (iPhone; U; CPU OS 10_1_1 like Mac OS X; en_us)
^ Gotta be iOS Safari, right?
2.MobileSMS/1.0 CFNetwork/808.1.4 Darwin/16.1.0`
^ I think MobileSMS means imessage (hopefully)
Mozilla/5.0 (iPhone; CPU iPhone OS 10_1_1 like Mac OS X) AppleWebKit/602.1.32 (KHTML, like Gecko) Mobile/14B100 Twitter for iPhone
^ Twitter via webkit webview?
Mozilla/5.0 (iPhone; CPU iPhone OS 10_1_1 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) CriOS/54.0.2840.91 Mobile/14B100 Safari/602.1
^ more iOS Chrome (i see you CriOS)
Mozilla/5.0 (iPhone; CPU iPhone OS 10_1_1 like Mac OS X) AppleWebKit/602.2.14 (KHTML, like Gecko) Version/10.0 Mobile/14B100 Safari/602.1
^ more iOS Chrome?
Twitter/5002568 CFNetwork/760.6.3 Darwin/15.6.0 (x86_64)
^ Twitter
I've just faced the same issue while trying to re-route the iMessage crawler to a non-angular page which will generate the correct meta tags for it and found this question in the process. Figured I'd write an answer since I've now found it. Apple's documentation says nothing but mention the ...(Applebot/x.x) User-Agent which is not the correct one. I've found nothing on the internet so I logged traffic to just one file on a public server and shared the link via iMessage. In the log file I received:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/601.2.4 (KHTML, like Gecko) Version/9.0.1 Safari/601.2.4 facebookexternalhit/1.1 Facebot Twitterbot/1.0
When I've modified my RegEx to fit this User-Agent, the iMessage crawler was finally re-routed to the correct location.
So there it is, it's probably subject to change without notice since it does not exist in any official Apple documentation as far as I can tell but I hope this still helps someone :)
Use this regex to identify requests from IMsg crawlers.
(Twitterbot(.*)facebookexternalhit)|(facebookexternalhit(.*)Twitterbot)
I have tested it and it works perfectly.

iPad vs iPad Mini User Agent

We're doing some server side device detection and need to drive ipad mini users to one page and ipad users to another.
Is there any thing that differentiates the two user agents?
iPad
Mozilla/5.0 (iPad; CPU OS 7_0_3 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11B511 Safari/9537.53`
Mini
Mozilla/5.0 (iPad; CPU OS 7_0_4 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11B554a Safari/9537.53
The only thing I see is the Mobile/11B511 and Mobile/11B554a, but is that a persistent value that we can work off?
Trying to do a device detection these days is hard and not reliable. I would recommend you instead of device detection to do a detection based on browser capabilities like I described it here.
Using this approach you are interested only if the browser supports a feature and you don't care about the device name/vendor.

IBM Worklight 6.0 - Reports log for Windows Phone 8 display a USER_AGENT than other environments

My team is facing some layout issues on Windows Phone 8 for our App that extensively uses JQuery 1.3.1, which by the way works like a charm on Android and iOS.
Doing some investigation we noticed the USER_AGENT column on the reports table APP_ACTIVITY_REPORT is missing a bit of info comparing to similar entries for other OS.
Android
Mozilla/5.0 (Linux; U; Android 4.1.2; pt-br; GT-N8000 Build/JZO54K)
AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0
Safari/534.30/Worklight/6.0.0
iOS
Mozilla/5.0 (iPhone; CPU iPhone OS 7_0_2 like Mac OS X)
AppleWebKit/537.51.1 (KHTML, like Gecko) Mobile/11A501
(391584416)/Worklight/6.0.0 Mozilla/5.0 (iPad; CPU OS 7_0_2 like Mac
OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Mobile/11A501
(384361824)/Worklight/6.0.0
Windows Phone 8
Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0;
IEMobile/10.0; ARM; Touch; NOKIA; Lumia 720) <---- NO WORKLIGHT
STRING PRESENT
The question is more about if for some reason this /Worklight/6.0.0 segment present on both Android and iOS indicates that something is wrong with the WP8 environment, which could be affecting the performance of jQuery Mobile WP8 app in Worklight?
The "Worklight" string in the user agent is used for supporting IBM WebSphere Portal and it is not related to anything else you have mentioned re jQuery Mobile performance in Windows Phone 8.
The "Worklight" string does not appear in the Windows Phone 8 user agent because it was not implemented to be there. Again, this is of no consequence to you in regards to this question.

Find iPhone Model Information via Browser

Is it possible to get the model information of an iPhone hitting a web page? I've looked at the User Agent, but it doesn't seem to have this information encoded within it. Essentially, I want to do this but from a browser.
They do have different user agent strings. iPhone 4 is
Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7
You can find the complete list here: http://www.zytrax.com/tech/web/mobile_ids.html

Resources