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

Banner not shown: beforeinstallpromptevent.preventDefault() called. The page must call beforeinstallpromptevent.prompt() to show the banner. #823

Closed
Merite15 opened this issue Feb 6, 2025 · 2 comments

Comments

@Merite15
Copy link

Merite15 commented Feb 6, 2025

I encounter a problem with vite pwa when redirecting urls with parameters I am on nuxt 3.15.4 and I use @vite-pwa/nuxt 0.10.6

@userquin
Copy link
Member

userquin commented Feb 6, 2025

No idea what's the problem, redirection and before install prompt are not related, check the following components:

You need to show your badge when showInstallPrompt Vue ref is activated (Elk will show it only when there is no new version), then call install. The install prompt is about preventing default browser behavior (show the browser banner), not about calling programatically browser logic (you cannot): will work only on chromium based browsers ( https://caniuse.com/?search=beforeinstallprompt ).

You need to include both components in all your layouts (the prompt only if you're using prompt for update), will require some changes if also showing offline ready badge (Elk not using it).

https://github.com/search?q=repo%3Aelk-zone%2Felk%20PwaInstallPrompt&type=code

@Merite15
Copy link
Author

Merite15 commented Feb 6, 2025

Thanks I will try this

@Merite15 Merite15 closed this as completed Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants