Bug 132681 - [GTK] Use a different user agent string depending on the site
Summary: [GTK] Use a different user agent string depending on the site
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: Gtk
Depends on: 133403
Blocks:
  Show dependency treegraph
 
Reported: 2014-05-08 06:51 PDT by Carlos Garcia Campos
Modified: 2014-06-11 00:39 PDT (History)
15 users (show)

See Also:


Attachments
Patch (19.29 KB, patch)
2014-05-08 07:04 PDT, Carlos Garcia Campos
no flags Details | Formatted Diff | Diff
Try to fix mac build (20.65 KB, patch)
2014-05-08 08:31 PDT, Carlos Garcia Campos
no flags Details | Formatted Diff | Diff
Updated patch (23.14 KB, patch)
2014-05-27 01:57 PDT, Carlos Garcia Campos
andersca: review+
buildbot: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from webkit-ews-16 for mac-mountainlion-wk2 (530.49 KB, application/zip)
2014-05-27 05:05 PDT, Build Bot
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Garcia Campos 2014-05-08 06:51:43 PDT
We have changed the user agent string several times to try to fix broken websites that require specific things in the UA string to properly work. But everytime we change the UA string to fix and website we break others. So, we could use different UA string depending on the web site when the site specific quirks setting is enabled. We used to do this in WebKit1, but it was never ported to WebKit2.
Comment 1 Carlos Garcia Campos 2014-05-08 07:04:31 PDT
Created attachment 231063 [details]
Patch

I have converted the latest changes to the user agent as site specific quirks
Comment 2 Carlos Garcia Campos 2014-05-08 08:31:19 PDT
Created attachment 231068 [details]
Try to fix mac build
Comment 3 Gustavo Noronha (kov) 2014-05-08 09:15:49 PDT
Comment on attachment 231068 [details]
Try to fix mac build

LGTM, I think we'll want to add the google bits from before to stop getting the second-class pages for google, but I really like how you structured it. I guess we need a wk2 owner to stamp it though?
Comment 4 Carlos Garcia Campos 2014-05-08 09:31:35 PDT
Adding wk2 owners to the CC.
Comment 5 Sergio Villar Senin 2014-05-08 10:13:57 PDT
Comment on attachment 231068 [details]
Try to fix mac build

View in context: https://bugs.webkit.org/attachment.cgi?id=231068&action=review

I like the patch. My only concern is having to add new broken sites to the code as we find them, but I guess we've lost the race for the works-for-all-sites UA many times.

> Source/WebCore/platform/gtk/UserAgentGtk.cpp:146
> +        uaString.appendLiteral(" Version/6.0");

Some users reported that some sites where complaining about using an old Safari version. Should we use 7.0 (or the most recent one)?

> Source/WebCore/platform/gtk/UserAgentGtk.cpp:189
> +    }

We used to have rules also for google domains in WK1. Time to resurrect them?
Comment 6 Carlos Garcia Campos 2014-05-08 10:30:29 PDT
(In reply to comment #5)
> (From update of attachment 231068 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=231068&action=review
> 
> I like the patch. My only concern is having to add new broken sites to the code as we find them, but I guess we've lost the race for the works-for-all-sites UA many times.

Yes.

> > Source/WebCore/platform/gtk/UserAgentGtk.cpp:146
> > +        uaString.appendLiteral(" Version/6.0");
> 
> Some users reported that some sites where complaining about using an old Safari version. Should we use 7.0 (or the most recent one)?

I don't know, I didn't want to change the current behaviour for the specific sites that caused the UA changes.

> > Source/WebCore/platform/gtk/UserAgentGtk.cpp:189
> > +    }
> 
> We used to have rules also for google domains in WK1. Time to resurrect them?

Yes, but again, I wanted this patch to fix the sites that required to change the UA string lately, and at the same time fix all other sites that don't require it and were doing weird things, like bugzilla setting your OS as MAC OS or sites that offer the mac download instead of the linux one. 

Once this patch lands, we can add new specific site quirks like google sites easily.
Comment 7 Carlos Garcia Campos 2014-05-22 06:14:06 PDT
We should probably also change the enable-site-specific-quirks setting default value to TRUE when thnis patch lands. What do you think?
Comment 8 Carlos Garcia Campos 2014-05-27 01:57:17 PDT
Created attachment 232118 [details]
Updated patch

Rebased to apply on current git master and changed the default value of the site specific quirks setting.
Comment 9 WebKit Commit Bot 2014-05-27 01:57:50 PDT
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Comment 10 Build Bot 2014-05-27 05:05:15 PDT
Comment on attachment 232118 [details]
Updated patch

Attachment 232118 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.appspot.com/results/5189048809291776

New failing tests:
media/W3C/video/readyState/readyState_during_canplay.html
Comment 11 Build Bot 2014-05-27 05:05:21 PDT
Created attachment 232122 [details]
Archive of layout-test-results from webkit-ews-16 for mac-mountainlion-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: webkit-ews-16  Port: mac-mountainlion-wk2  Platform: Mac OS X 10.8.5
Comment 12 Sergio Villar Senin 2014-05-27 09:49:03 PDT
www.icloud.com reports unsupported browser even with the "Safari v6" thing. That's why I thing that seems to be too old. Something to take into account when adding site specific quirks
Comment 13 Carlos Garcia Campos 2014-05-27 10:17:46 PDT
(In reply to comment #12)
> www.icloud.com reports unsupported browser even with the "Safari v6" thing. That's why I thing that seems to be too old. Something to take into account when adding site specific quirks

Ok, I want to land this patch first as a base and then add google and any other site specific quirks.
Comment 14 Carlos Garcia Campos 2014-05-30 08:22:59 PDT
Could a WebKit2 owner review the cross-platform changes, please?
Comment 15 Carlos Garcia Campos 2014-06-11 00:39:17 PDT
Committed r169799: <http://trac.webkit.org/changeset/169799>