stackernews / stacker.news

Internet communities that pay you Bitcoin
https://stacker.news
MIT License
428 stars 109 forks source link

Stacker news tries to install itself as a PWA - any way to opt out? #953

Closed Kodylow closed 6 months ago

Kodylow commented 7 months ago

Not sure how new this is but stacker news tries to install itself as a PWA when you navigate to it in Fedi's browser, could we disable this? It's already a mod within Fedi so this installation screen is unnecessary. We route to mods with a URL link so could we add a query param to the url like ?promptDownloadPwa=false to stop it?

image

ekzyis commented 7 months ago

The prompt from react-ios-pwa-prompt is triggered while mounting the app in pages/_app.js:

https://github.com/stackernews/stacker.news/blob/4b4a5361ef29fd0c51325a1e8a44d20b8195b019/pages/_app.js#L106-L109

Looking at its code, it should be possible to conditionally render it by passing in 0 for timesToShow when it shouldn't show.

To make this less fragile (since it depends on the component tree not remounting without this param set), one could also set the item in localStorage that it reads to make it never appear again.

I am curious though, what is this Fedi(mint?) browser? Is it public? Can we try it? Haven't found anything about it on fedimint.org or when searching for "fedimint browser".

Kodylow commented 7 months ago

Fedi (the company) has "mods" in the app where you can go to a website with webln, web.nostr, and some other bitcoin tools injected. Just use Fedi and connect to any federation, then in settings add a mod for stacker.news or some federations have it set as default.

Can I set that timesToShow as a query parameter? the only control I have is the initial URL I set for the federation meta

ekzyis commented 6 months ago

Fedi (the company) has "mods" in the app where you can go to a website with webln, web.nostr, and some other bitcoin tools injected. Just use Fedi and connect to any federation, then in settings add a mod for stacker.news or some federations have it set as default.

Ahh, ok!

Can I set that timesToShow as a query parameter? the only control I have is the initial URL I set for the federation meta

No, not yet, that needs to be added as code.

huumn commented 6 months ago

Deploying this now.

@Kodylow you'll want to use ?disablePrompt=true