La PWA desktop funziona con Discourse!

Per Hands-On with Microsoft's New Edge Browser Built on Chromium - Thurrott.com

When it comes to features, Edge has the one critical item that always kept me crawling back to Chrome. If you are on a webpage, you can easily turn it into an app, by clicking the three dots in the top right and clicking install app. This is huge, as it allows me to turn Google Calendar, Tweetdeck, and a few other pages into applications on my desktop that makes my workflow, a lot easier.

:thinking: we should definitely whitelist all Chrome based browsers @falco

8 Mi Piace

Looks like Chrome Canary is experimenting with a more in your face install button:

Here is it in Meta when the service worker is working:

13 Mi Piace

Niiiice. We should definitely get this working on Chrome. I like it.

6 Mi Piace

We want to get this working, but the last time we tried with the “You are offline” page wasn’t a great experience. Also we had a lot of suggestions about making reading Discourse possible when you are offline.

Using some libraries from GitHub - GoogleChrome/workbox: 📦 Workbox: JavaScript libraries for Progressive Web Apps I was able to:

  • Remove the “You are offline” page

  • Make Discourse fallback to cache when a network request fail aka Discourse will allow offline browsing of every previously visited page.

  • Get a perfect score in the PWA Lighthouse audit:

  • Get the “Install Site” on the Desktop working (availiable in Chrome canary for now, will land in stable around August)

    image

Technical Details

The changes are pending in this branch: https://github.com/discourse/discourse/compare/offline

A demo site is running at https://discourse-workbox.muito.ninja/

27 Mi Piace

Here is a demo of Discourse offline browsing on iPad

14 Mi Piace

Can you create topics offline that get synced with the server when the device is back online?

The current changes only affect GET requests, so it will make you able to use the composer, if you ever did it while online.

Discourse already keeps submitting a topic in a persistent “Saving” blue bar, and this doesn’t touch that request, so it should keep the current behavior.

However, getting Discourse to work totally in write mode while offline would require a lot more work and be a long term project involving multiple people. That is not the scope here, which is just enabling installs in Desktop.

9 Mi Piace

cc @falco

In Chrome 76, we’re making it easier for users to install Progressive Web Apps on the desktop by adding an install button to the omnibox.

16 Mi Piace

Okay, this is live in Meta for testing now. Please report any crazyness.

Here is Meta install:

6 Mi Piace

Is there a flag we can set to tinker with this on our own installations?

4 Mi Piace

It’s in the same branch as always here. You could deploy from that branch but it is a lot behind master currently. I can rebase it to master, but I don’t recommend messing with this until it’s proven stable here.

Another cool thing, if you try to use the pwa with a cold cache:

13 Mi Piace

Questo è attivo sull’ultima versione di Discourse tests-passed.

Si prega di segnalare eventuali bug in nuovi argomenti.

12 Mi Piace

Chrome 76 è stato lanciato ieri con il pulsante di invito all’azione Installa nella barra degli indirizzi, e l’ultima versione di Discourse funziona con esso immediatamente.

15 Mi Piace

Funziona confermato su Chrome 76, rilasciato oggi: c’è persino un’animazione piuttosto complessa nella barra degli indirizzi :exclamation: che attira l’attenzione.

Sembra che l’animazione avvenga solo una volta per dominio.

Tecnicamente è stato rilasciato, ma lo considero ancora piuttosto sperimentale, quindi riaprirò l’argomento.

11 Mi Piace

C’è un modo per nascondere l’icona nella barra degli indirizzi, sia da Discourse che da Chrome? Preferisco usare solo il browser, quindi non vedo il senso di tenere quell’icona visibile per sempre.

Probabilmente una domanda meglio indirizzata agli sviluppatori del browser Chrome, non a noi.

7 Mi Piace

Ho cercato su Google lato Chrome, ma non ho trovato nulla. Quindi immagino che lo chiederò direttamente a loro.

È qualcosa che potrebbe essere teoricamente ignorato (ad esempio tramite localStorage) o nascosto permanentemente in base a un’impostazione di Discourse? Chiedo perché non so se Chrome rileva automaticamente se il sito web è compatibile come PWA o se c’è qualche flessibilità dal vostro lato per offrire l’opzione solo in determinate condizioni.

Per chiunque altro sia interessato, c’è un’impostazione in chrome://flags chiamata App Banners che puoi impostare su Disabled per rimuovere l’icona nella barra degli indirizzi.

EDIT: In realtà, l’impostazione rilevante sembra essere Desktop PWAs installabili dall'omnibox.

7 Mi Piace

Solo per informazione, oggi su Chrome su Linux (Ubuntu) ho persino ricevuto un popup che mi proponeva di “installare” Discourse come un’app. Qualcosa di simile ai popup quando i siti web chiedono di autorizzare le notifiche.

Sta cercando Chrome di spingere per questo tipo di “installazioni”?

Un popup sul desktop!?

Hai uno screenshot?

4 Mi Piace