Bug 199904 - Ensure Quirks::shouldDispatchSimulatedMouseEvents() works for all Google Maps and Amazon domains
Summary: Ensure Quirks::shouldDispatchSimulatedMouseEvents() works for all Google Maps...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: UI Events (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Antoine Quint
URL:
Keywords: InRadar
Depends on:
Blocks: 279250
  Show dependency treegraph
 
Reported: 2019-07-18 05:51 PDT by Antoine Quint
Modified: 2024-09-06 01:24 PDT (History)
3 users (show)

See Also:


Attachments
Patch (4.09 KB, patch)
2019-07-18 13:33 PDT, Antoine Quint
dino: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Antoine Quint 2019-07-18 05:51:50 PDT
A comment made on https://bugs.webkit.org/show_bug.cgi?id=198657 indicates that the quirk added to dispatch simulated mouse events to the Street View icon on Google Maps only works on the google.com domain but Google Maps could also be served via a google.co.jp or google.fr domain for which the quirk doesn't work! Likewise, Quirks::shouldDispatchSimulatedMouseEvents() uses amazon.com to check whether we are on an Amazon property, but this is bad since Amazon also uses amazon.fr and other local domains.
Comment 1 Radar WebKit Bug Importer 2019-07-18 05:52:12 PDT
<rdar://problem/53250104>
Comment 2 Michael Catanzaro 2019-07-18 10:53:33 PDT
The solution we use for Google user agent quirks is:

String baseDomain = topPrivatelyControlledDomain(url.host().toString());
if (baseDomain.startsWith("google."))
   // do something

We also have quirks for gstatic.com, googleapis.com, and googleusercontent.com, but none of those are likely relevant to your Maps problem.
Comment 3 Antoine Quint 2019-07-18 10:55:25 PDT
Thanks Michael, this is really helpful! I'll use a similar approach to detect a Google and Amazon property.
Comment 4 Antoine Quint 2019-07-18 13:33:46 PDT
Created attachment 374408 [details]
Patch
Comment 5 Antoine Quint 2019-07-18 14:56:43 PDT
Committed r247621: <https://trac.webkit.org/changeset/247621>