RESOLVED FIXED 124229
[GTK] Remove Chromium as user agent and claim to be Safari on OS X
https://bugs.webkit.org/show_bug.cgi?id=124229
Summary [GTK] Remove Chromium as user agent and claim to be Safari on OS X
Víctor M. Jáquez L.
Reported 2013-11-12 13:29:08 PST
Steps to reproduce: A) 1. create an account on Duolingo and complete the tutorial B) 1. log in with an existing account. Result: Only the background and the menus are shonw Expected result: A floating frame with the course status.
Attachments
the page is rendered correctly using chromium (345.19 KB, image/png)
2013-11-12 13:31 PST, Víctor M. Jáquez L.
no flags
page is not rendered right with epiphany (452.90 KB, image/png)
2013-11-12 13:32 PST, Víctor M. Jáquez L.
no flags
Patch (3.09 KB, patch)
2013-11-13 08:09 PST, Víctor M. Jáquez L.
no flags
Patch (4.12 KB, patch)
2013-11-19 09:02 PST, Víctor M. Jáquez L.
no flags
Patch (4.32 KB, patch)
2013-11-20 07:43 PST, Víctor M. Jáquez L.
no flags
Víctor M. Jáquez L.
Comment 1 2013-11-12 13:31:15 PST
Created attachment 216714 [details] the page is rendered correctly using chromium
Víctor M. Jáquez L.
Comment 2 2013-11-12 13:32:27 PST
Created attachment 216715 [details] page is not rendered right with epiphany this is also shown using minibroswer and gtklauncher using current master
Martin Robinson
Comment 3 2013-11-12 14:20:15 PST
Some errors on the console: [Error] TypeError: undefined is not an object (evaluating 'duo.user.get') (anonymous function) (all.js, line 78) [Error] ReferenceError: Can't find variable: chrome render (f5c9405066ce187ddd25fa480d65fd02_mv_.min.js, line 467) switchView (f5c9405066ce187ddd25fa480d65fd02_mv_.min.js, line 191) home (f5c9405066ce187ddd25fa480d65fd02_mv_.min.js, line 898) (anonymous function) (1b104f59bca045b5837b0eb7f0d6de09_mv_.min.js, line 271) (anonymous function) (anonymous function) (1b104f59bca045b5837b0eb7f0d6de09_mv_.min.js, line 277) some any (1b104f59bca045b5837b0eb7f0d6de09_mv_.min.js, line 226) loadUrl (1b104f59bca045b5837b0eb7f0d6de09_mv_.min.js, line 277) loadUrl (f5c9405066ce187ddd25fa480d65fd02_mv_.min.js, line 905) start (1b104f59bca045b5837b0eb7f0d6de09_mv_.min.js, line 276) (anonymous function) (f5c9405066ce187ddd25fa480d65fd02_mv_.min.js, line 902) t (1b104f59bca045b5837b0eb7f0d6de09_mv_.min.js, line 66) fireWith (1b104f59bca045b5837b0eb7f0d6de09_mv_.min.js, line 67) ready (1b104f59bca045b5837b0eb7f0d6de09_mv_.min.js, line 56) K (1b104f59bca045b5837b0eb7f0d6de09_mv_.min.js, line 65) It looks like the page is looking for Chromium specific (!) variables in the window object.
Víctor M. Jáquez L.
Comment 4 2013-11-12 18:57:13 PST
> It looks like the page is looking for Chromium specific (!) variables in the window object. Yes, as the minibrowser and gtklaunch sets as user-agent "Chrome" (among others) a js script assumes it is a chromium browsers and calls a chromium specific variable (yeah). As a workaround, if we remove the Chrome thing in the user-agent string, the page is rendered normally. So, I don't think this is WebKit bug, but a bug in the js script, or perhaps (maybe) in the browser, which uses that user-agent.
Martin Robinson
Comment 5 2013-11-13 00:08:15 PST
(In reply to comment #4) > So, I don't think this is WebKit bug, but a bug in the js script, or perhaps (maybe) in the browser, which uses that user-agent. We may need to think of a workaround. Clearly there are problems with pretending to be Chromium. We may need to start pretending to be OS X Safari.
Sergio Villar Senin
Comment 6 2013-11-13 00:22:56 PST
(In reply to comment #5) > (In reply to comment #4) > > > So, I don't think this is WebKit bug, but a bug in the js script, or perhaps (maybe) in the browser, which uses that user-agent. > > We may need to think of a workaround. Clearly there are problems with pretending to be Chromium. We may need to start pretending to be OS X Safari. Agree specially after the fork, engines might start to diverge quickly.
Víctor M. Jáquez L.
Comment 7 2013-11-13 08:09:10 PST
Martin Robinson
Comment 8 2013-11-13 08:16:12 PST
Comment on attachment 216802 [details] Patch We can't just claim to be Safari. We need to claim to be Safari on OS X. It's in the comment! :)
Víctor M. Jáquez L.
Comment 9 2013-11-13 08:35:28 PST
(In reply to comment #8) > (From update of attachment 216802 [details]) > We can't just claim to be Safari. We need to claim to be Safari on OS X. It's in the comment! :) I don't understand why we need to say we are running OS X. Do you mean something like this: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.13+ (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2 from here: http://www.useragentstring.com/pages/Safari/
Martin Robinson
Comment 10 2013-11-13 08:47:03 PST
(In reply to comment #9) > Do you mean something like this: > Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.13+ (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2 from here: http://www.useragentstring.com/pages/Safari/ Yes. When we claim to be Safari on Linux, some sites assume that Safari && !OSX is Safari && iOS. iOS pages are often light-weight versions that aren't suitable for desktop display or are missing resources such as custom fonts.
Víctor M. Jáquez L.
Comment 11 2013-11-13 09:00:25 PST
(In reply to comment #10) > (In reply to comment #9) > > Do you mean something like this: > > Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.13+ (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2 > from here: http://www.useragentstring.com/pages/Safari/ > > Yes. When we claim to be Safari on Linux, some sites assume that Safari && !OSX is Safari && iOS. iOS pages are often light-weight versions that aren't suitable for desktop display or are missing resources such as custom fonts. AAAhhh..the comment in code was a @TODO ... roger that!
Martin Robinson
Comment 12 2013-11-13 09:23:12 PST
(In reply to comment #11) > AAAhhh..the comment in code was a @TODO ... roger that! Not really a TODO. We had essentially two choices: we could either claim to be Safari + OS X or Chromium on the proper operating system. The previous version just claimed to be Safari on Linux, which led to issues. The comment tried to explain the situation.
Víctor M. Jáquez L.
Comment 13 2013-11-19 09:02:45 PST
Martin Robinson
Comment 14 2013-11-19 09:56:06 PST
Comment on attachment 217303 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=217303&action=review > Source/WebCore/platform/gtk/UserAgentGtk.cpp:47 > +#if CPU(PPC) || CPU(PPC64) > +#define PROCESSOR "PPC" > +#elif CPU(X86) || CPU(X86_64) > +#define PROCESSOR "Intel" > +#elif CPU(ARM) || CPU(ARM64) > +#define PROCESSOR "ARM" > +#else > +#define PROCESSOR "Unknown" > +#endif I'd rather this be a function than a preprocessor definition. Perhaps something like "cpuDescriptionForUSAString" > Source/WebCore/platform/gtk/UserAgentGtk.cpp:74 > +#elif OS(DARWIN) || OS(UNIX) > + uaOSVersion = String(PROCESSOR " Mac OS X"); > #else I think a small comment here could be useful. We need to explain that Linux+Safari triggers the iOS path on some websites.
Víctor M. Jáquez L.
Comment 15 2013-11-20 07:43:48 PST
Martin Robinson
Comment 16 2013-11-20 08:42:04 PST
Comment on attachment 217431 [details] Patch Okay. We need to test this *very thoroughly* before releasing it.
Víctor M. Jáquez L.
Comment 17 2013-11-20 10:12:16 PST
(In reply to comment #16) > (From update of attachment 217431 [details]) > Okay. We need to test this *very thoroughly* before releasing it. I'll commit it. But I have no idea how to test it. Do you mean to see the user experience in a ton of real websites?
WebKit Commit Bot
Comment 18 2013-11-20 10:41:38 PST
Comment on attachment 217431 [details] Patch Clearing flags on attachment: 217431 Committed r159572: <http://trac.webkit.org/changeset/159572>
WebKit Commit Bot
Comment 19 2013-11-20 10:41:41 PST
All reviewed patches have been landed. Closing bug.
Martin Robinson
Comment 20 2013-11-20 10:58:21 PST
(In reply to comment #17) > (In reply to comment #16) > > (From update of attachment 217431 [details] [details]) > > Okay. We need to test this *very thoroughly* before releasing it. > > I'll commit it. But I have no idea how to test it. Do you mean to see the user experience in a ton of real websites? Yep. Exactly. We need to ensure that this doesn't introduce more problems than it solves. User agents are very delicate.
mknepher
Comment 21 2014-01-07 10:42:46 PST
Running Fedora 20 with epiphany-3.10.3 / webkitgtk3-2.2.3, and Amazon's cloud reader at https://read.amazon.com now throws up an unsupported browser page. It lists acceptable browsers as: Chrome 20+ Safari 5+ Firefox 10+ IE 10+ I'm not sure when this change made it into Fedora, but I've been running 20 since alpha, and I know the site was working as of a few weeks ago.
Michael Catanzaro
Comment 22 2015-11-16 09:34:48 PST
(In reply to comment #3) > Some errors on the console: > > [Error] TypeError: undefined is not an object (evaluating 'duo.user.get') > (anonymous function) (all.js, line 78) > [Error] ReferenceError: Can't find variable: chrome > render (f5c9405066ce187ddd25fa480d65fd02_mv_.min.js, line 467) > switchView (f5c9405066ce187ddd25fa480d65fd02_mv_.min.js, line 191) > home (f5c9405066ce187ddd25fa480d65fd02_mv_.min.js, line 898) > (anonymous function) (1b104f59bca045b5837b0eb7f0d6de09_mv_.min.js, line 271) > (anonymous function) > (anonymous function) (1b104f59bca045b5837b0eb7f0d6de09_mv_.min.js, line 277) > some > any (1b104f59bca045b5837b0eb7f0d6de09_mv_.min.js, line 226) > loadUrl (1b104f59bca045b5837b0eb7f0d6de09_mv_.min.js, line 277) > loadUrl (f5c9405066ce187ddd25fa480d65fd02_mv_.min.js, line 905) > start (1b104f59bca045b5837b0eb7f0d6de09_mv_.min.js, line 276) > (anonymous function) (f5c9405066ce187ddd25fa480d65fd02_mv_.min.js, line 902) > t (1b104f59bca045b5837b0eb7f0d6de09_mv_.min.js, line 66) > fireWith (1b104f59bca045b5837b0eb7f0d6de09_mv_.min.js, line 67) > ready (1b104f59bca045b5837b0eb7f0d6de09_mv_.min.js, line 56) > K (1b104f59bca045b5837b0eb7f0d6de09_mv_.min.js, line 65) > > It looks like the page is looking for Chromium specific (!) variables in the > window object. Martin, my worry is that if we put Chromium in the user agent by default, we'll have similar issues on various sites. I've never seen something like this occur without Chromium in the UA.
Martin Robinson
Comment 23 2015-11-16 09:41:50 PST
(In reply to comment #22) > (In reply to comment #3) > > Some errors on the console: > > > > [Error] TypeError: undefined is not an object (evaluating 'duo.user.get') > > (anonymous function) (all.js, line 78) > > [Error] ReferenceError: Can't find variable: chrome > > render (f5c9405066ce187ddd25fa480d65fd02_mv_.min.js, line 467) > > switchView (f5c9405066ce187ddd25fa480d65fd02_mv_.min.js, line 191) > > home (f5c9405066ce187ddd25fa480d65fd02_mv_.min.js, line 898) > > (anonymous function) (1b104f59bca045b5837b0eb7f0d6de09_mv_.min.js, line 271) > > (anonymous function) > > (anonymous function) (1b104f59bca045b5837b0eb7f0d6de09_mv_.min.js, line 277) > > some > > any (1b104f59bca045b5837b0eb7f0d6de09_mv_.min.js, line 226) > > loadUrl (1b104f59bca045b5837b0eb7f0d6de09_mv_.min.js, line 277) > > loadUrl (f5c9405066ce187ddd25fa480d65fd02_mv_.min.js, line 905) > > start (1b104f59bca045b5837b0eb7f0d6de09_mv_.min.js, line 276) > > (anonymous function) (f5c9405066ce187ddd25fa480d65fd02_mv_.min.js, line 902) > > t (1b104f59bca045b5837b0eb7f0d6de09_mv_.min.js, line 66) > > fireWith (1b104f59bca045b5837b0eb7f0d6de09_mv_.min.js, line 67) > > ready (1b104f59bca045b5837b0eb7f0d6de09_mv_.min.js, line 56) > > K (1b104f59bca045b5837b0eb7f0d6de09_mv_.min.js, line 65) > > > > It looks like the page is looking for Chromium specific (!) variables in the > > window object. > > Martin, my worry is that if we put Chromium in the user agent by default, > we'll have similar issues on various sites. I've never seen something like > this occur without Chromium in the UA. I guess we can always try to file a bug with Typescript and hope for the best. :)
Martin Robinson
Comment 24 2015-11-16 09:42:30 PST
(In reply to comment #23) > I guess we can always try to file a bug with Typescript and hope for the > best. :) Sorry. I meant "TypeKit" here.
Note You need to log in before you can comment on or make changes to this bug.