This site blocks the login page completely and asks the user to download Google Chrome when using our standard user agent. It only blocks the login page. After logging in, it works fine without user agent quirks. I added a new quirk called 'NeedsNoSafariVersion' for it because the site still blocks the page if both 'Chrome/' and 'Version/' exist in the user agent string. Therefore, I need a way to not only add 'Chrome/' but also remove 'Version/'.
Created attachment 394169 [details] Patch
Created attachment 394171 [details] Patch
Comment on attachment 394171 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=394171&action=review OK this looks basically good, but let's simplify it a bit, because it reveals a problem with our existing Chrome quirk. > Source/WebCore/platform/UserAgentQuirks.cpp:157 > + // This site does not recognize Chrome/X with Version/X as a valid Chrome > + // user agent, so we have to hide Version/X from the user agent. OK, this just indicates that our current Google Chrome quirk is broken, and we just got lucky that the existing sites we use it on didn't notice. We don't need a new quirk here; instead, we should fix the existing quirk to not include Version/X. > Source/WebCore/platform/glib/UserAgentGLib.cpp:113 > // Version/X is mandatory *before* Safari/X to be a valid Safari UA. See > // https://bugs.webkit.org/show_bug.cgi?id=133403 for details. > - uaString.appendLiteral("Version/13.0 Safari/"); > + if (!quirks.contains(UserAgentQuirks::NeedsNoSafariVersion)) > + uaString.appendLiteral("Version/13.0 "); So this can become an else clause of the previous condition. Then it will get added except when the Chrome quirk is in use. (Or when the Firefox quirk is in use, but we already returned early up above in that case.)
Created attachment 394469 [details] Patch
Created attachment 394482 [details] Patch
I haven't figured out how to run WebKit tests, so I don't know if the test I modified in the patch passes.
Committed r258978: <https://trac.webkit.org/changeset/258978> All reviewed patches have been landed. Closing bug and clearing flags on attachment 394482 [details].