PWA de bureau fonctionne avec 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 « J'aime »

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

https://twitter.com/henrylim96/status/1110916077519699970

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

13 « J'aime »

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

6 « J'aime »

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 · GitHub 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 « J'aime »

Here is a demo of Discourse offline browsing on iPad

https://giant.gfycat.com/BlushingGreedyGiantschnauzer.mp4

14 « J'aime »

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 « J'aime »

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 « J'aime »

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

Here is Meta install:

6 « J'aime »

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

4 « J'aime »

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 « J'aime »

Cela est en direct sur la dernière version de Discourse tests-passed.

Veuillez signaler tout bug dans de nouveaux sujets.

12 « J'aime »

Chrome 76 a été lancé hier avec l’appel à l’action « Installer » dans la barre omnibox, et la dernière version de Discourse fonctionne avec dès la sortie.

15 « J'aime »

Fonctionne confirmé dans Chrome 76, publié aujourd’hui. Il y a même une animation assez complexe dans la barre d’adresse :exclamation: qui attire l’attention.

Il semble que l’animation ne se produise qu’une seule fois par domaine.

Ceci est techniquement livré, mais je le considère toujours comme plutôt expérimental, je réouvre donc le sujet.

11 « J'aime »

Y a-t-il un moyen de masquer l’icône dans la barre d’adresse, que ce soit depuis Discourse ou depuis Chrome ? Je préfère utiliser simplement le navigateur, donc je ne vois pas l’intérêt de laisser cette icône visible indéfiniment.

C’est probablement une question mieux adressée aux développeurs du navigateur Chrome, pas à nous.

7 « J'aime »

J’ai cherché un peu du côté de Chrome, mais je n’ai rien trouvé. Je vais donc leur poser la question.

Est-ce que cela pourrait être théoriquement dismissable (par exemple via localStorage) ou masqué définitivement en fonction d’un paramètre Discourse ? Je demande cela car je ne sais pas si Chrome détecte automatiquement si le site est compatible PWA ou s’il existe une certaine flexibilité de votre côté pour n’offrir l’option que conditionnellement.

Pour toute autre personne intéressée, il existe un paramètre dans chrome://flags nommé App Banners que vous pouvez définir sur Désactivé pour supprimer l’icône dans la barre d’adresse.

EDIT : En fait, le paramètre pertinent semble être Desktop PWAs installable from the omnibox.

7 « J'aime »

Juste pour information, aujourd’hui sur Chrome sous Linux (Ubuntu), j’ai même eu une fenêtre contextuelle me proposant d’« installer » Discourse comme une application. Quelque chose de similaire aux pop-ups lorsque les sites demandent l’autorisation d’envoyer des notifications.

Chrome essaie-t-il de promouvoir ce genre d’« installations » ?

Une fenêtre contextuelle sur le bureau ?!

Avez-vous une capture d’écran ?

4 « J'aime »