Accept the Bertina Browser token in the supported-browser check (Chromium 158 based)

Aperta Adatta ai principianti
#66,922 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
62/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
javascript, typescript
Ambito
frontend

Direzione di ricerca

Inizia da core/src/services/BrowsersListService.ts, dove viene costruito supportedBrowsersRegExp e AscDesktopEditor è già aggiunto all'espressione, poi controlla testSupportedBrowser() in core/src/utils/RedirectUnsupportedBrowsers.js. Verifica che le stringhe user-agent Bertina/158.0.0.0 citate nella issue non passino l'attuale regex e che corrispondano dopo la modifica. Il lavoro è completo quando quelle stringhe superano il controllo, le versioni di Chromium inferiori alla 111 continuano a essere reindirizzate e il comportamento esistente per i browser supportati resta invariato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

[!TIP]

Help move this idea forward
  • Use the 👍 reaction to show support for this feature.
  • Avoid commenting unless you have relevant information to add; unnecessary comments create noise for subscribers.
  • Subscribe to receive notifications about status changes and new comments.

Is your feature request related to a problem? Please describe.

Users of Bertina Browser are sent to the "Your browser is not supported" page (/unsupported) on Nextcloud servers. Bertina is built on Chromium 158 (Windows, Linux, macOS, Android; download page, in Persian: https://bertina.me/download), but it identifies itself with its own product token and does not send a Chrome/ token:

Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Bertina/158.0.0.0 Safari/537.36
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Bertina/158.0.0.0 Mobile Safari/537.36

supportedBrowsersRegExp in core/src/services/BrowsersListService.ts is generated from the browserslist config, so it has no entry that can match this string, and testSupportedBrowser() in core/src/utils/RedirectUnsupportedBrowsers.js redirects.

How this was checked: the expression was rebuilt locally from master with [email protected] and @nextcloud/[email protected]; it does not match the strings above and does match the same strings with Chrome/158.0.0.0. The report came from a Bertina user who met the page on a Nextcloud server; we have not tested against a server instance ourselves.

Describe the solution you'd like

Accept the Bertina/<version> token for versions 111 and above (the token's major version is the Chromium major version), in the place where AscDesktopEditor is already appended to the expression. For example:

+ '|AscDesktopEditor|Bertina\\/(11[1-9]|1[2-9]\\d|[2-9]\\d\\d)'

We are happy to send a pull request if this approach is acceptable.

Describe alternatives you've considered

  • The "Continue with this unsupported browser" button works, but users read the page as "this browser cannot be used here".
  • Detecting through User-Agent Client Hints: Bertina sends Sec-CH-UA: "Chromium";v="158", "Not.A/Brand";v="24", "Bertina Browser";v="158", so a check of navigator.userAgentData.brands for Chromium ≥ 111 would cover Bertina and any other Chromium-based browser without naming each one.

Additional context

Submitted on behalf of the Bertina Browser project. Prepared with the help of an AI coding assistant; the measurements above were run before submission.

Lingua principale
PHP
Stelle
37.6k
Fork
5.4k
Merge medio
1g 16h
PR unite (30g)
660

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di nextcloud/server

Tutte le issue di nextcloud/server

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.