nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
26.12k stars 3.93k forks source link

Supporting GNOME Web / Epiphany web browser #40793

Open Nico7as opened 9 months ago

Nico7as commented 9 months ago

I got a warning message about my browser not being supported (Epiphany a.k.a. Gnome Web) the last time logged in my Nextcloud account.

I reached out to the Epiphany developers and after some researches, they told me that the issue came from NextCloud. Might be "user agent header" related, or It might come from an API incompatibility with WebKitGTK.

Since NextCloud is well integrated to Gnome, I naively thought that everything would be 100% compatible between both plateforms.

I understand that Epiphany is quite confidential, being exclusive to Linux, where Firefox and Chromium/Chrome are way more popular. Still, it's a polished and well integrated browser, part of the Gnome DE, which is a very popular DE among mainline distributions. And it allows to "install" websites as webapps. Very convinient for NextCloud's Deck, for exemple.

I wish you could make NC Epiphany friendly :-)

Cheers

mcatanzaro commented 9 months ago

OK, problem here is all the information required to fix this issue is in your Epiphany issue report, but you did not link to it, greatly reducing the chances of this being fixed. So, following that link is important. ;)

Some notes:

mcatanzaro commented 9 months ago

Oh and I eventually figured out that browserslist is an external project https://github.com/browserslist/browserslist-useragent-regexp but haven't looked closer than that.

joshtrichards commented 9 months ago

Browser compatibility checking (at least any centralized) seems defined here:

https://github.com/nextcloud-libraries/browserslist-config/blob/master/browserlist.config.js

And is built around Browserslist.

You can see what this translates to by running that filter through the library's checker here:

https://browsersl.ist/#q=%3E0.25%25%2C+not+op_mini+all%2C+not+dead%2C+Firefox+ESR

(with some variance depending on NC version and build time)

Interestingly, I don't see Safari 16.4 on the list...

Browserslist uses the data from CanIUse by way of caniuse-lite.

Also notable and relevant: https://github.com/Fyrd/caniuse/issues/6807

Nico7as commented 9 months ago

@mcatanzaro Thanks for adding the link, and relevant info !

I get the warning message after the logging in.

And I forgot to give my versions:

mcatanzaro commented 9 months ago

Interestingly, I don't see Safari 16.4 on the list...

Well that's surely the problem. The Nextcloud UI says that 16.4 is supported, but its caniuse usage data is lower than 0.25% so it's excluded from your browserlist filter. Surely Nextcloud's UI shouldn't be inconsistent with the filter. If you change the filter to >0.25%, Safari >= 16.4, not op_mini all, not dead, Firefox ESR then I bet it would work.

But I assume many other websites are likely using browserlist too. I never imagined that these unsupported browser warnings would be based on caniuse.com data. It's probably time for me to bump the fake Safari version in WebKitGTK's user agent header -- I normally do this once or twice per year -- but I would bump it to the latest version 17.0, which is also apparently < 0.25% and therefore also won't be matched by your query. The defaults query includes last 2 versions to address this, but it's missing from your config. So I would add that too.

Unfortunately browserlist is counting each Safari minor version rather than only counting the major versions, so the last two versions are actually 17.0 and 16.6. It seems last 2 Safari major versions would avoid this, but that's not part of defaults so I can't expect websites to use it. Sigh.

I will bump our fake Safari version to 17.0 now. I wonder how many websites would break if I set it to something higher than the latest version....

joshtrichards commented 9 months ago

It seems we also have allowHigherVersions toggled on:

https://github.com/nextcloud/server/blob/71cd97c37f9879c3c8ee06e8a56f8995b0195f45/core/src/services/BrowsersListService.js#L29

This should cover Safari v16.4 just fine (and, in turn, Epiphany).

Anyhow, I installed Epiphany on my Debian 12 workstation and reproduced the behavior only in the latest major version of NC (v27), but neither of the still supported major versions (v25, v26) consider Epiphany unsupported.

So I think we're running into an inadvertent regression, possibly from bumping up a dependency (like browserslist-useragent).

And the warning here about using allowHigherVersions:

https://github.com/browserslist/browserslist-useragent#when-querying-for-modern-browsers

...makes me wonder if we should switch to unreleased versions + ignoreMinor instead.

joshtrichards commented 9 months ago

Nextcloud 26 (or 25, I'm not sure)

@Nico7as: Can you confirm the server version you're seeing this in with certainty? I'm only able to reproduce it in 27.

Nico7as commented 9 months ago

I've asked on the forum. I'll give you the answer as soon as I can.

I'm not running NC my self, but subscribing to it as a service. I assumed the server weren't upgraded to NC27 yet, cause it seems to recent. The Zaclys company is small, they upgrade the shared servers when they can.

joshtrichards commented 9 months ago

Is it their shared server at https://ncloud.zaclys.com/ or a dedicated one?

If the former, it looks like it's v24.0.11 (Enterprise Edition).

If dedicated, you can visit your https://domain.tld/status.php on your server to probably find out.

Nico7as commented 9 months ago

no, mine is https://acloud2.zaclys.com

"nclouds" are free, and basics "aclouds" are for paid subscribers (a = abonné in french = subscribers), with more apps, and more storage they're updated more often

joshtrichards commented 9 months ago

Cool. You're running v27.1.1. :-)

Okay good. That matches my testing. So this is some sort of regression it seems.

mcatanzaro commented 9 months ago

For completeness: WebKit bug to bump Safari version

Nico7as commented 9 months ago

@joshtrichards Yes, and now it know how to find it by myself :-). Didn't see the arrow on the left, to get more details...

thanks again you both @mcatanzaro & @joshtrichards for spending time on this !!

Makes me want to give more user feedbacks to the softwares I use !