Bug 171941 - [GTK] Remove Firefox user agent quirk for Google domains
Summary: [GTK] Remove Firefox user agent quirk for Google domains
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: Other
Hardware: PC Linux
: P2 Normal
Assignee: Michael Catanzaro
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-05-10 13:12 PDT by Michael Catanzaro
Modified: 2021-03-09 08:33 PST (History)
5 users (show)

See Also:


Attachments
Patch (13.55 KB, patch)
2017-05-10 15:13 PDT, Michael Catanzaro
no flags Details | Formatted Diff | Diff
Patch (8.53 KB, patch)
2017-05-20 08:25 PDT, Michael Catanzaro
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Catanzaro 2017-05-10 13:12:33 PDT
Testing indicates that we can probably remove our user agent quirks for Google domains, but only if we always claim to be "Linux x86_64". We should do this anyway (except on macOS). Sending any other operating system (except Windows, which WebKitGTK+ does not support) or architecture in the user agent string is an invitation to breakage, and should only be done with quirks on an as-needed basis. Reporting an accurate architecture here also makes it needlessly-difficult to handle bug reports from BSD users.
Comment 1 Michael Catanzaro 2017-05-10 13:18:46 PDT
We should wait several days before committing this (to trunk only). I've asked for people to try Google with user agent quirks disabled and want to make sure we don't get reports that contradict my experience today before committing.
Comment 2 Michael Catanzaro 2017-05-10 15:13:07 PDT
Created attachment 309645 [details]
Patch
Comment 3 Michael Catanzaro 2017-05-15 08:54:13 PDT
Another option: we might decide to drop the Firefox quirk, but keep the Linux platform quirk.
Comment 4 Ting-Wei Lan 2017-05-19 08:05:50 PDT
I think 'always claim to be Linux' itself is a quirk. Doing so may make testing easier and reduce the number of bug reports related to user agent, but it is still an unexpected behaviour that is visible to users. Although websites providing FreeBSD-specific downloads are much less than websites providing Linux downloads, it is still possible to see unexpected results on websites like bugzilla. If bugzilla automatically selects 'Linux' for the operating system field instead of the operating system you use, it is an unexpected behaviour.

I think we should not apply a quirk to all websites only because Google needs it. It makes this bug report looks like the 'always claim to be macOS' patch used in some old releases. I agree that we can remove the 'Firefox' quirk and keep only the 'Linux x86_64' quirk, but it should only be done for Google websites, not other untested websites.

Since there are always user agent problems, is it better to make the quirk list modifiable at runtime? Is there a policy deciding whether a quirk can be included in WebKit? There are some web apps that can be installed by different organizations under different domain names, is it possible to support them? For example, some versions of Microsoft Outlook Web App require either macOS quirk or Linux Firefox quirks to prevent it from switching to lite mode.
Comment 5 Michael Catanzaro 2017-05-19 08:13:42 PDT
Yeah, I was having second thoughts about this already... exactly what I was thinking. Let's remove our Firefox quirk for Google, but keep the Linux platform quirk.

And yes, it would be best for the quirks to be modifiable at runtime, but I don't plan to work on that. Websites that require quirks are broken by definition, and the only reason we should be messing with the quirks is to find new quirks. The runtime setting you found (disable-site-specific-quirks) works well enough for that purpose.

(In reply to Ting-Wei Lan from comment #4)
> Since there are always user agent problems, is it better to make the quirk
> list modifiable at runtime? Is there a policy deciding whether a quirk can
> be included in WebKit? There are some web apps that can be installed by
> different organizations under different domain names, is it possible to
> support them? For example, some versions of Microsoft Outlook Web App
> require either macOS quirk or Linux Firefox quirks to prevent it from
> switching to lite mode.

Yes, it's basically impossible to fix this client-side, other than to add them all to a big list. I'm happy to keep a huge list of domain names in WebKit, including internal corporate domains, if you want to add some (separate bug report, please). It could be used as encouragement to Microsoft or its customers to recognize this problem.
Comment 6 Michael Catanzaro 2017-05-20 08:25:31 PDT
Created attachment 310770 [details]
Patch
Comment 7 Michael Catanzaro 2017-05-20 08:28:36 PDT
(This one *should* be backported to 2.16, since it reduces our risk of Google using Firefox-specific JS.)
Comment 8 WebKit Commit Bot 2017-05-21 23:27:08 PDT
Comment on attachment 310770 [details]
Patch

Clearing flags on attachment: 310770

Committed r217203: <http://trac.webkit.org/changeset/217203>
Comment 9 WebKit Commit Bot 2017-05-21 23:27:10 PDT
All reviewed patches have been landed.  Closing bug.