Bug 233027 - [GTK] Bogus "Browser not supported" message on wordpress.com
Summary: [GTK] Bogus "Browser not supported" message on wordpress.com
Status: NEW
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: 2021-11-11 20:52 PST by Ryan Farmer
Modified: 2021-11-15 11:59 PST (History)
4 users (show)

See Also:


Attachments
Screenshot of the error. (72.30 KB, image/png)
2021-11-11 20:52 PST, Ryan Farmer
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ryan Farmer 2021-11-11 20:52:01 PST
Created attachment 444040 [details]
Screenshot of the error.

Logging in to Wordpress.com in GNOME Web 41 from Flatpak results in a page called "Browse Happy" that says I need a different browser.

This made me unhappy.

The options are to continue anyway, or learn about supported browsers on https://browsehappy.com/ which implies that not using one of the major web browsers puts you at risk on the web.

I'm not quite sure how to do a UA override on the Flatpak version so not sure what would be the best option for a UA spoof.
Comment 1 Carlos Garcia Campos 2021-11-11 22:30:50 PST
I guess we need a user gent quirk for wordpress. Michael, could you look at this one?
Comment 2 Michael Catanzaro 2021-11-12 12:53:13 PST
It doesn't seem to be happening with blogs.gnome.org.

This is going to require some trial and error with Ryan. If we're lucky, we culd have one quirk for browsehappy.net, and that would solve this for every Wordpress site. Otherwise, probably all we can do is add a quirk just for wordpress.com. Anyway, if Ryan is OK with building WebKit from source, then I'll post two test patches next week, one for browsehappy.net and the other for wordpress.com, and Ryan can report which one of the two solves the problem. (I assume one or the other will work. Not guaranteed, but likely.)
Comment 3 Teodor 2021-11-12 15:22:35 PST
Please, see https://bugs.webkit.org/show_bug.cgi?id=233073

This bug may be related to the lack of "Version/X" in UA string.
Comment 4 Michael Catanzaro 2021-11-12 15:36:13 PST
(In reply to Teodor from comment #3)
> Please, see https://bugs.webkit.org/show_bug.cgi?id=233073
> 
> This bug may be related to the lack of "Version/X" in UA string.

We do have Version/X hardcoded in UserAgentGLib.cpp, so it's not that. User agent construction on Mac is completely different.

It's very common for websites to intentionally break themselves when they see WebKit on Linux, and we normally fix this with quirks to pretend to be either macOS or else Chrome. Such websites simply lose the right to receive an accurate user agent header from WebKit. The only thing unusual about this bug report is that Wordpress is deployed on millions of servers, so a quirk for wordpress.com alone may not do much good.
Comment 5 Ryan Farmer 2021-11-12 21:07:07 PST
Are there instructions somewhere that I could use to build this on Debian or is this something that could get pushed to the Epiphany Tech Preview Flatpak. 

Is that still around?

The part about this maybe not only affecting Wordpress.com is....troubling. 

They hit me with "Browse Happy" again today (while logged in) when I went to click on My Stats, and it seems like every once in a while they want to nag you, then it goes away for a while.
Comment 6 Michael Catanzaro 2021-11-13 09:30:56 PST
(In reply to Ryan Farmer from comment #5)
> Are there instructions somewhere that I could use to build this on Debian or
> is this something that could get pushed to the Epiphany Tech Preview
> Flatpak.

Some instructions here: https://trac.webkit.org/wiki/BuildingGtk

Ephy Tech Preview flatpak uses the real GNOME master runtime, so it's not a good place for testing changes before they make it into WebKit.
Comment 7 Michael Catanzaro 2021-11-15 11:59:20 PST
Anyway, here's the first test patch:

diff --git a/Source/WebCore/platform/UserAgentQuirks.cpp b/Source/WebCore/platform/UserAgentQuirks.cpp
index 5373b579ee3e..a31b16b6b976 100644
--- a/Source/WebCore/platform/UserAgentQuirks.cpp
+++ b/Source/WebCore/platform/UserAgentQuirks.cpp
@@ -119,6 +119,11 @@ static bool urlRequiresMacintoshPlatform(const String& domain, const String& bas
         || domain == "exchange.tu-berlin.de")
         return true;
 
+    // wordpress.com displays an unsupported broswer warning with WebKitGTK's
+    // standard user agent. browsehappy.com is their browser support domain.
+    if (baseDomain == "browsehappy.com")
+        return true;
+
     return false;
 }
 
I doubt it will work, but maybe, if we're lucky. Next test patch:

diff --git a/Source/WebCore/platform/UserAgentQuirks.cpp b/Source/WebCore/platform/UserAgentQuirks.cpp
index 5373b579ee3e..8979d7693881 100644
--- a/Source/WebCore/platform/UserAgentQuirks.cpp
+++ b/Source/WebCore/platform/UserAgentQuirks.cpp
@@ -119,6 +119,11 @@ static bool urlRequiresMacintoshPlatform(const String& domain, const String& bas
         || domain == "exchange.tu-berlin.de")
         return true;
 
+    // wordpress.com displays an unsupported broswer warning with WebKitGTK's
+    // standard user agent.
+    if (baseDomain == "browsehappy.com")
+        return true;
+
     return false;
 }
 
If neither patch works, then please open the network tab in the web inspector and give me a list of every domain that's loaded, so we can try to guess which domain requires the quirk.