User agent string for iPhone web page saved as icon

bogdog400 - September 22, 2009 - 18:58
Project:Browscap
Version:HEAD
Component:Miscellaneous
Category:bug report
Priority:normal
Assigned:Unassigned
Status:duplicate
Description

Browsecap works wonderfully when I visit the site via Safari. But if I save the page to the desktop, then it loads the regular page. This may be a problem with browscap, but I thought I would mention it here.

This is the user agent generated from my iPod Touch running 3.1.1 when I visit the site by clicking on an icon on the desktop:

Mozilla/5.0 (iPod; U; CPU iPhone OS 3_1_1 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Mobile/7C145

#1

greggles - September 25, 2009 - 15:19
Status:active» postponed (maintainer needs more info)

But if I save the page to the desktop, then it loads the regular page.

Do you mean that you make a bookmark of it on the iPod Touch "desktop" ?

I imagine you are also using Mobile Tools, right? I think this could be a Mobile Tools problem because that user agent seems clearly to be iPod.

#2

bogdog400 - September 28, 2009 - 14:56

Nope. I've only got Browscap and Mobile Theme modules on this site.

So I think it might have to do with the database of browser types. Is there someway to get this agent type added to the database?

#3

bogdog400 - September 28, 2009 - 14:59

Do you mean that you make a bookmark of it on the iPod Touch "desktop" ?

Yup. When I hit the "+" key in Safari, and hit the "add to home screen" button. An icon appears, a splash screen appears when the icon is hit, and then I get a different theme because Mobile Theme doesn't recognize it as a truly mobile user agent. The stats page also shows that it doesn't recognize it because it just displays it as:

Mozilla/5.0 (iPod; U; CPU iPhone OS 3_1_1 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Mobile/7C145

Thanks for your help!

#4

greggles - September 28, 2009 - 15:20

Is there any research you have done to conclude that the problem is in Browscap as opposed to Mobile Theme?

#5

bogdog400 - September 29, 2009 - 14:22

Is there any research you have done to conclude that the problem is in Browscap as opposed to Mobile Theme?

Yup. If I go to the page directly from an iPhone version of Safari, it serves up the Mobile theme. But if I go from the desktop version, it doesn't. In the stats for Browscap report, the user agent for this particular case is just reported separately. The others get lumped together with iPhone as they should. So I just assume that Browscap doesn't find this in the database at all. Is that a fair assumption?

Here's what the report looks like:

User agent Count Percent Crawler?
iPhone 167 48.2659 No
Safari 4.0 89 25.7225 No
Google 38 10.9827 Yes
Browscap Abusers 34 9.8266 No
Image Crawlers 6 1.7341 Yes
Inktomi 6 1.7341 Yes
Mozilla/5.0 (iPod; U; CPU iPhone OS 3_1_1 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Mobile/7C145 3 0.8671 No
IE 8.0 1 0.2890 No
taptubot; requests from this IP address are taptubot, see http://taptu.com/corp/taptubot 1 0.2890 No
Firefox 3.5 1 0.2890 No

Am I thinking correctly?

#6

greggles - September 29, 2009 - 14:30
Status:postponed (maintainer needs more info)» active

That seems to be accurate, yes. Unfortunately I'm not sure where the problem is but perhaps you can debug the code more or another maintainer might have advice.

#7

bogdog400 - September 29, 2009 - 19:20

What is the easiest way to edit the db? I can certainly figure out how to add new user agent strings, but everything else is a blob. How can I figure out the structure of the blob? Any suggestions?

#8

bogdog400 - September 30, 2009 - 13:38
Status:active» patch (to be ported)

I poked around the db and changed one of the entries from:

Mozilla/5.0 (iPod; U; CPU iPhone OS 3_0_0 like Mac OS X; %) AppleWebKit/% (KHTML, like Gecko)

To:

Mozilla/5.0 (iPod; U; CPU iPhone OS 3_% like Mac OS X; %) AppleWebKit/% (KHTML, like Gecko) %

The user agent might be 3.1 or it will probably be 3.2 soon. I also added the percent sign at the end to match some extra stuff at the end.

This seems to fix the problem but it's far from ideal because the db needs to be updated permanently.

#9

greggles - September 30, 2009 - 13:46
Status:patch (to be ported)» duplicate

There's an issue at #570932: Administration to edit the Browscap data for allowing admins to override the underlying data in a way that gets preserved - I'm marking this as a duplicate of that.

To fix the general problem, I suggest contacting Gary http://browsers.garykeith.com/contact-me.asp

 
 

Drupal is a registered trademark of Dries Buytaert.