httpagentparser icon indicating copy to clipboard operation
httpagentparser copied to clipboard

Blackberry not recognized

Open oliver opened this issue 14 years ago • 7 comments

It would be neat if httpagentparser would detect BlackBerry browsers.

In some server logs I found the following UA strings containing BlackBerry:

"BlackBerry8310/4.5.0.174 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/124" "BlackBerry8310/4.5.0.69 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/114" "BlackBerry8520/4.6.1.314 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/124" "BlackBerry8900/4.6.1.310 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/114" "BlackBerry8900/5.0.0.1036 Profile/MIDP-2.1 Configuration/CLDC-1.1 VendorID/124" "BlackBerry8900/5.0.0.681 Profile/MIDP-2.1 Configuration/CLDC-1.1 VendorID/124" "BlackBerry9000/4.6.0.303 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/114" "BlackBerry9000/5.0.0.1036 Profile/MIDP-2.1 Configuration/CLDC-1.1 VendorID/124" "BlackBerry9300/5.0.0.794 Profile/MIDP-2.1 Configuration/CLDC-1.1 VendorID/114" "BlackBerry9500/4.7.0.78 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/124" "BlackBerry9500/5.0.0.841 Profile/MIDP-2.1 Configuration/CLDC-1.1 VendorID/124" "BlackBerry9520/5.0.0.1077 Profile/MIDP-2.1 Configuration/CLDC-1.1 VendorID/124" "BlackBerry9700/5.0.0.344 Profile/MIDP-2.1 Configuration/CLDC-1.1 VendorID/124" "BlackBerry9700/5.0.0.442 Profile/MIDP-2.1 Configuration/CLDC-1.1 VendorID/612" "BlackBerry9700/5.0.0.593 Profile/MIDP-2.1 Configuration/CLDC-1.1 VendorID/114" "BlackBerry9700/5.0.0.593 Profile/MIDP-2.1 Configuration/CLDC-1.1 VendorID/114 Webwasher/6.8.7" "BlackBerry9700/5.0.0.593 Profile/MIDP-2.1 Configuration/CLDC-1.1 VendorID/604" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0) BlackBerry8700/4.1.0 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/100" "Mozilla/5.0 (BlackBerry; U; BlackBerry 9700; de) AppleWebKit/534.8+ (KHTML, like Gecko) Version/6.0.0.448 Mobile Safari/534.8+" "Mozilla/5.0 (BlackBerry; U; BlackBerry 9700; de) AppleWebKit/534.8+ (KHTML, like Gecko) Version/6.0.0.668 Mobile Safari/534.8+" "Mozilla/5.0 (BlackBerry; U; BlackBerry 9700; es) AppleWebKit/534.8+ (KHTML, like Gecko) Version/6.0.0.344 Mobile Safari/534.8+" "Mozilla/5.0 (BlackBerry; U; BlackBerry 9780; de) AppleWebKit/534.8+ (KHTML, like Gecko) Version/6.0.0.546 Mobile Safari/534.8+" "Mozilla/5.0 (BlackBerry; U; BlackBerry 9800; de) AppleWebKit/534.1+ (KHTML, like Gecko) Version/6.0.0.246 Mobile Safari/534.1+" "Mozilla/5.0 (BlackBerry; U; BlackBerry 9800; de) AppleWebKit/534.1+ (KHTML, like Gecko) Version/6.0.0.337 Mobile Safari/534.1+"

oliver avatar Jan 01 '12 13:01 oliver

Hi Oliver, if you could tell me what is expected return when we some of these agent strings to detect function I would soon add support.

shon avatar Jan 04 '12 07:01 shon

Based on http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/How-to-detect-the-BlackBerry-Browser/ta-p/559862 and http://www.useragentstring.com/BlackBerry_id_17117.php maybe the results for the UA strings posted above could be like this:

  • the first batch of UA strings (with "Profile/MIDP") is from BlackBerryOS 4 and 5 (exact OS version can be extracted from the "BlackBerry8310/4.5.0.174" part); the second batch is from BlackBerryOS 6 and 7 (exact OS version can be extracted from the "Version/6.0.0.448" part)
  • so os.name should always be "BlackBerryOS", and os.version can be anything from 4.5.0.174 to 7.0.0.1
  • if the UA string contains "Profile/MIDP", this is apparently some RIM self-made browser on Java basis, so browser.name could be "BlackBerry", and browser.version could be left out (at most, the BlackBerryOS version could be used here again)
  • for other UA strings, browser.name could be "Safari" and browser.version left out (again, looks like there's no usable Safari version number directly available from the UA strings)

I think "dist" and "flavor" can be left empty for these UAs.

What do you think?

oliver avatar Jan 04 '12 20:01 oliver

I just submitted a pull request which I think addresses this. It does not get the version, but it detects Blackberry phones and tablet (Playbook) correctly.

srs81 avatar Mar 29 '12 18:03 srs81

Thanks srs81. Do you think flavor "Playbook" is more appropriate? Specifically the last test. Further the string mentions "RIM Tablet OS 1.0.0".

shon avatar Apr 02 '12 15:04 shon

Hi, sure. The only problem with that is: in my specific tests, I often have a "higher level" categorization based on OS, and a lower level one based on the specfic type. That's why for Android, I have added the tablet and phone-specific checks. Is there a way to designate the Playbook as a "Playbook" distribution for the "Blackberry" OS?

srs81 avatar Apr 02 '12 16:04 srs81

Hello, I believe this is fixed, and can be closed, yes? :)

srs81 avatar Sep 05 '12 22:09 srs81

It does detect OS but does not detect version yet. Further it fails for "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0) BlackBerry8700/4.1.0 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/100". Although this perhaps is a corner case. So I think we should leave it open till above issues are addressed.

shon avatar Sep 27 '12 11:09 shon