Can browscap provide all the information needed?

48 views
Skip to first unread message

Mikolaj Misiurewicz

unread,
Jul 28, 2013, 11:12:00 AM7/28/13
to browsc...@googlegroups.com
Hi,
as I've written in the main browscap group - I've created a project https://github.com/quentin389/UserAgentInfo

It uses browscap, Mobile-Detect and ua-parser in attempt to get as much information from user agent string as possible. Right now none of those three projects can give you the full package.

I've created the project mainly because browscap kind of died. I've been adding my own user agents to browscap locally for quite some time (you can see them in BrowscapWrapper.class.php), but recently the number of new strings to add just became too high. In addition to that, I've had a separate class for mobile redirections in my code for ages. So, I've decided to create something that won't require of me to just sit and add new user agents all the time, and will return all the user agent string info I need.

Right now the class uses browscap very specific information if it's provided, but for new browsers and for anything even remotely related to mobile, it uses Mobile-Detect and ua-parser.

I'm sure that in time, when the browscap project (hopefully) gets back on track, there will be more and more information that it will be able to provide by itself.


There are some conclusions, relevant to the browscap project, that I've arrived at when creating UserAgentInfo. Most of the stuff is written either in readme.md file or as a comments to the classes. However, here are some additional thoughts:

1) There were some doubts raised in https://groups.google.com/forum/#!topic/browscap-dev/iCWCXcXotl4 whether to identify tablet devices or not. In my opinion having to use a separate script for mobile detection when you have browscap providing you a lot of very detailed information is really strange. Scripts like Mobile-Detect deal really well with the issue of whether something is a tablet, phone or desktop and I see no reason not to add this distinction to browscap in the future (but NOT as a replacement for specific device detection).

2) Browscap sucks really badly when it comes to any kind of mobile device detection (not only because of lack of is_tablet property). The simple reason for that is probably that it was dead and mobile world changes super fast. If you want for browscap to really get back on track and have any use at all for identifying mobile devices, you will have to add a lot of new rules to the parser.

3) Browscap is the most detailed user agent project out of those I've checked. Thanks to that, when browscap data IS available, you can be almost sure that the user agent was identified correctly (eg. browscap won't detect IE version 999 as a proper browser, other parsers will). That's a great strength, but also a weakness when it comes to check like is_mobile, is_bot etc. That's why I've introduced two levels of user agent identification in my project: full and partial. This way I know whether something was identified very specifically, most likely a proper identification, or based on generic checks like substr('Mobile'). In my opinion such approach gets best from two worlds. And you can always choose to trust just the full identification.
Does it make sense to add such generic checks to browscap? If you don't do that, then I think that people will always try to use other classes for generic information detection. Even in things like bot detection it makes sense to just look for 'bot' string in user agent when the string as a whole is not identified.


I know you'll be rewriting browscap, so if you think you can use some of the stuff from my project, I'll be glad to help :)


Btw: the reason I've created my project this way, is because while I can make time to update such generic class, sitting and updating user agent detection strings is something that just takes waaaay to much time. Kudos to people who actually do that (especially to Gary K!).

Cheers,
Mikolaj

James Titcumb

unread,
Jul 29, 2013, 4:04:12 AM7/29/13
to Mikolaj Misiurewicz, browsc...@googlegroups.com
Hi Mikolaj,

Thanks for your post!

1) I am in favour of implementing a property in the future to identify tablets

2) I think you are correct - because updates have been few and far between, not just mobile detection, but any recent UA detection has been lacking in the project. We are hoping a new release will happen soon.

3) It may be possible to add "partial" identification in the future, that's something we'll have to look into.

The rewrite we are doing pertains to the generation of the files, and the website. It's important to note that the format of the files (at least initially) will not be changed. One of our goals is backwards compatibility with some legacy systems, but perhaps creating a new file format to allow future improvement and updates!

Although it is still early days in our plans, any feedback on what we're doing is definitely appreciated, so of course your comments will be considered :)

Thanks
James



--
You received this message because you are subscribed to the Google Groups "browscap-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to browscap-dev...@googlegroups.com.
To post to this group, send email to browsc...@googlegroups.com.
Visit this group at http://groups.google.com/group/browscap-dev.
 
 

Reply all
Reply to author
Forward
0 new messages