Bug 201995

Summary: Cannot drag blocks or spacers when editing pages on squarespace.com when UserAgent contains "Version/13" and is non-mobile
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: WebKit Misc.Assignee: Joseph Pecoraro <joepeck>
Status: NEW    
Severity: Normal CC: ap, bfulgham, cdumez, dbates, ews-watchlist, japhet, joepeck, jond, rniwa, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
[PATCH] Proposed Fix
rniwa: review+
[PATCH] Proposed Fix - Update iOS's custom user agent string joepeck: review-

Joseph Pecoraro
Reported 2019-09-19 12:20:06 PDT
Cannot drag blocks or spacers when editing pages on squarespace.com when UserAgent contains "Version/13" Steps to Reproduce: 1. Login to Squarespace 2. Start editing a page with a spacer 3. Attempt to drag the spacer => On Mac, cursor still shows dragging, and web app appears frozen. Notes: • Changing to use an older UserAgent, things behave as expected on macOS.
Attachments
[PATCH] Proposed Fix (9.13 KB, patch)
2019-09-19 12:23 PDT, Joseph Pecoraro
rniwa: review+
[PATCH] Proposed Fix - Update iOS's custom user agent string (12.00 KB, patch)
2019-09-20 18:23 PDT, Joseph Pecoraro
joepeck: review-
Joseph Pecoraro
Comment 1 2019-09-19 12:21:03 PDT
Joseph Pecoraro
Comment 2 2019-09-19 12:23:52 PDT
Created attachment 379151 [details] [PATCH] Proposed Fix
Ryosuke Niwa
Comment 3 2019-09-19 18:13:26 PDT
Comment on attachment 379151 [details] [PATCH] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=379151&action=review > Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm:842 > -String WebPage::platformUserAgent(const URL&) const > +String WebPage::platformUserAgent(const URL& url, const String& currentUserAgent) WebPage::platformUserAgent for iOS has a similar logic for shouldAvoidUsingIOS13ForGmail. Can we share code with that?
Joseph Pecoraro
Comment 4 2019-09-19 19:24:28 PDT
> WebPage::platformUserAgent for iOS has a similar logic for shouldAvoidUsingIOS13ForGmail. > Can we share code with that? The iOS path changes the platform version ("iPhoneOS 13_0" to "iPhoneOS 12_1_3"), and only on "mail.google.com". For example: iOS 13 iPhone on about:blank: js> navigator.userAgent "Mozilla/5.0 (iPhone; CPU iPhone OS 13_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.1 Mobile/15E148 Safari/604.1" iOS 13 iPhone on mail.google.com: js> navigator.userAgent "Mozilla/5.0 (iPhone; CPU iPhone OS 12_1_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko)" This patch is changing the browser version ("Version/13.0" to "Version/12.0"). And it needs to happen on any *.squarespace.com subdomain since that is where the editor may live. Since this affects potentialy far more sites, it seems worthwhile to include as much of the user agent string as possible. For example: macOS 10.15 with Safari 13 on about:blank: js> navigator.userAgent "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0 Safari/605.1.15" macOS 10.15 with Safari 13 on any `squarespace.com` / `*.squarespace.com`: js> navigator.userAgent "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 Safari/605.1.15" --- We could probably improve the `shouldAvoidUsingIOS13ForGmail` path on iOS to also include the browser level information ("Version/13.0.1 Mobile/15E148 Safari/604.1") which currently gets dropped on the floor. But I think that can be considered separately.
Ryosuke Niwa
Comment 5 2019-09-19 19:26:48 PDT
Comment on attachment 379151 [details] [PATCH] Proposed Fix ok
Joseph Pecoraro
Comment 6 2019-09-20 15:00:56 PDT
Looks like we will have to do this for iOS as well.
Joseph Pecoraro
Comment 7 2019-09-20 18:22:55 PDT
The cases where Squarespace mishandles things is when it performs the following UserAgent queries: "./src/main/webapp/universal/src/shared/utils/isAppleiPadOS13.js": function(e, t, n) { "use strict"; e.exports = function() { var e = window.navigator.userAgent.toLowerCase(), t = e.indexOf("version/13"), n = e.indexOf("safari/"); return -1 < e.indexOf("intel mac os x 10_15") && -1 < t && -1 < n && t < n } }, So "Version/13", "Safari/" and "intel mac os x 10_15". This affects: • macOS • iPadOS using Desktop UserAgent We can decide to override these in various ways. I'm choosing to set "Version/12.0" as that seems like a minor edit. We could be stricter about when we modify the user agent, such as also looking for "Safari/". Either way, hopefully Squarespace will fix their content soon. It seems a small change on their end would make this unnecessary. ("touchend" => "gesturemoveend")! Putting up a new patch to handle the iPadOS using a Desktop User Agent case.
Joseph Pecoraro
Comment 8 2019-09-20 18:23:16 PDT
Created attachment 379300 [details] [PATCH] Proposed Fix - Update iOS's custom user agent string
Joseph Pecoraro
Comment 9 2019-09-25 20:33:53 PDT
Holding off on this I believe.
Note You need to log in before you can comment on or make changes to this bug.