Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Kodylow opened this issue Mar 21, 2024 · 4 comments
Closed

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

Kodylow opened this issue Mar 21, 2024 · 4 comments

Comments

@Kodylow
Copy link

Kodylow commented Mar 21, 2024

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

@Kodylow Kodylow added the bug label Mar 21, 2024
@ekzyis
Copy link
Member

ekzyis commented Mar 22, 2024

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

stacker.news/pages/_app.js

Lines 106 to 109 in 4b4a536

<ErrorBoundary>
<Component ssrData={ssrData} {...otherProps} />
<PWAPrompt copyBody='This website has app functionality. Add it to your home screen to use it in fullscreen and receive notifications. In Safari:' promptOnVisit={2} />
</ErrorBoundary>

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
Copy link
Author

Kodylow commented Mar 22, 2024

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
Copy link
Member

ekzyis commented Mar 24, 2024

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
Copy link
Member

huumn commented Mar 26, 2024

Deploying this now.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants