PWA de Desktop funciona com 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 curtidas

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 curtidas

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

6 curtidas

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 curtidas

Here is a demo of Discourse offline browsing on iPad

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

14 curtidas

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 curtidas

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 curtidas

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

Here is Meta install:

6 curtidas

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

4 curtidas

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 curtidas

Isso está ao vivo na versão mais recente do Discourse tests-passed.

Por favor, relate qualquer bug em novos tópicos.

12 curtidas

O Chrome 76 foi lançado ontem com o botão de ação ‘Instalar’ na barra omnibar, e o Discourse mais recente funciona com ele sem necessidade de configuração adicional.

15 curtidas

Confirmado como funcional no Chrome 76, lançado hoje. Há até uma animação bastante complexa na barra de endereços :exclamation: que chama a atenção para ela.

Parece que a animação ocorre apenas uma vez por domínio, no entanto.

Tecnicamente, isso já foi lançado, mas ainda considero bastante experimental, por isso estou reabrindo o tópico.

11 curtidas

Existe alguma maneira de ocultar o ícone na barra de endereços, seja pelo Discourse ou pelo Chrome? Prefiro usar apenas o navegador, então não vejo sentido em manter esse ícone visível para sempre.

Provavelmente uma pergunta melhor direcionada aos desenvolvedores do navegador Chrome, não a nós.

7 curtidas

Já pesquisei bastante no lado do Chrome, mas não encontrei nada. Então, acho que vou perguntar a eles.

Isso é algo que, teoricamente, poderia ser descartado (por exemplo, usando localStorage) ou ocultado permanentemente com base em uma configuração do Discourse? Estou perguntando porque não sei se o Chrome detecta automaticamente se o site é compatível como PWA ou se há alguma flexibilidade do seu lado para oferecer a opção apenas condicionalmente.

Para qualquer outra pessoa interessada, há uma configuração em chrome://flags chamada App Banners que você pode definir como Disabled para remover o ícone na barra de endereços.

EDIT: Na verdade, a configuração relevante parece ser Desktop PWAs installable from the omnibox.

7 curtidas

Apenas para informação: hoje, no Chrome no Linux (Ubuntu), recebi até mesmo um pop-up propondo que eu “instalasse” o Discourse como um aplicativo. Algo semelhante aos pop-ups que aparecem quando sites pedem permissão para enviar notificações.

O Chrome está tentando promover esse tipo de “instalação”?

Um pop-up no desktop!?

Você tem uma captura de tela?

4 curtidas