Bug 220836 - [Browser] SWT Safari Browser uses wrong 'user-agent' header resulting in some websites disabling functionality
Summary: [Browser] SWT Safari Browser uses wrong 'user-agent' header resulting in some...
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.4   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: 3.4 M6   Edit
Assignee: Grant Gayed CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2008-02-28 16:46 EST by David Green CLA
Modified: 2009-10-13 13:09 EDT (History)
3 users (show)

See Also:


Attachments
a patch that causes the Safari browser to append 'Safari/unknown' to the user-agent header, thus enabling gmail (3.56 KB, patch)
2008-02-28 16:46 EST, David Green CLA
no flags Details | Diff
evidence of the modified user-agent (153.99 KB, image/png)
2008-02-28 16:50 EST, David Green CLA
no flags Details
evidence of gmail working after applying the patch (73.91 KB, image/png)
2008-02-28 16:50 EST, David Green CLA
no flags Details
a patch to "Safari/412.0" user-agent (1.03 KB, patch)
2008-03-10 16:59 EDT, David Green CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Green CLA 2008-02-28 16:46:58 EST
Created attachment 91057 [details]
a patch that causes the Safari browser to append 'Safari/unknown' to the user-agent header, thus enabling gmail

Build ID: I20080207-1530

Steps To Reproduce:
Steps To Reproduce:
1.open a web browser in eclipse on mac
2.browse to whatsmyuseragent.com
3.notice that the user agent looks like 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_4_11; en) AppleWebKit/526+ (KHTML, like Gecko)'
4. browse to www.gmail.com, and try to open a valid gmail account
5. notice that gmail fails to recognize the browser as a supported browser
6. now open Safari from the mac desktop (not within eclipse)
7. browse to whatsmyuseragent.com and see the user-agent as 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_4_11; en) AppleWebKit/526+ (KHTML, like Gecko) Version/3.0.4 Safari/523.12.2'
8. now go back to www.gmail.com with the desktop-based Safari, and notice that gmail now accepts Safari as a supported browser


More information:
see related Tasktop issue https://tasktop.com/bugs/show_bug.cgi?id=14
Comment 1 David Green CLA 2008-02-28 16:50:10 EST
Created attachment 91058 [details]
evidence of the modified user-agent
Comment 2 David Green CLA 2008-02-28 16:50:56 EST
Created attachment 91059 [details]
evidence of gmail working after applying the patch
Comment 3 Grant Gayed CLA 2008-02-29 10:31:01 EST
Thanks for the patch!  Applied it with some modification > 0229

Comment 4 David Green CLA 2008-02-29 12:06:53 EST
Thanks for the fast response!!
Comment 5 David Green CLA 2008-03-10 16:55:18 EDT
The user-agent "Safari/unknown" works well for GMail, however Google Calendar doesn't like it.  The user-agent should be changed to a safe value that includes a version number that will be accepted by most websites.

See http://developer.apple.com/internet/safari/uamatrix.html for historical user-agent versions provided by Safari.

See https://tasktop.com/bugs/show_bug.cgi?id=14 for related discussion

Comment 6 David Green CLA 2008-03-10 16:59:33 EDT
Created attachment 92085 [details]
a patch to "Safari/412.0" user-agent

a patch attached that uses "Safari/412.0", which works for both GMail and Google Calendar, and which is safe in that it's the default version for freshly installed 'Tiger' installations.
Comment 7 Grant Gayed CLA 2008-03-11 10:24:40 EDT
The new version string seems fine, fixed > 0310

Comment 8 Oleksandr Maksymchuk CLA 2009-10-10 08:29:33 EDT
Could you please merge the last change into Cocoa branch too?
Comment 9 Grant Gayed CLA 2009-10-13 13:09:51 EDT
This should have been there already, but I see that it's still sending Safari/unknown there.  Fixed on Cocoa > 20091013 .