Is there any way to configure my manifest.json
to disable the browser popup asking to "install" the site?
I'm using the following JavaScript code to prevent it:
window.addEventListener('beforeinstallprompt', function(e) {
e.preventDefault();
return false;
});
But I need to prevent it also on the AMP version, and I can't run JavaScript code there.
From your app drawer or home screen, open Settings . See all apps. Find the PWA you want to remove and tap the icon. Tap Uninstall.
There is no need to search, download and update a PWA as with a native App; rather, users can download the App quickly and directly to their device.
Check if your PWA is installed # Finally, call navigator. getInstalledRelatedApps() from within the scope of your PWA to check if it is installed.
Currently, there doesn't appear to be an explicit setting to disable app install.
One workaround is to edit manifest.json
so that it doesn't meet the required criteria for app install banner, such as removing short_name
or icons
declarations.
You can do:
window.addEventListener('beforeinstallprompt', (event) => {
event.preventDefault()
})
Another workaround would be to set the display: 'browser'
option in the site.webmanifest
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With