admin管理员组文章数量:1277885
I am using Vite PWA plugin. The prompt behavior works but only while the browser is open. If I close the browser and open it again, a new service worker is activated without any prompts.
Is there a way to prevent it?
I need this because we don't want a new version of the app to be installed unless a user explicitly confirms it - it has to do with data integrity: a new version of the app might potentially break using the current user's data in Indexed DB.
Excerpt from my vite config:
VitePWA({
strategies: 'generateSW',
registerType: 'prompt',
devOptions: {
enabled: true,
},
filename: 'service-worker.js',
I tried both Vite PWA strategies: generateSW and injectManifest with custom service-worker.ts script
本文标签: vitePrevent Service Worker from automatically activating on browser restartStack Overflow
版权声明:本文标题:vite - Prevent Service Worker from automatically activating on browser restart - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741276833a2369776.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论