feat: add pwa
This commit is contained in:
@@ -32,6 +32,8 @@ export default {
|
||||
|
||||
if (typeof window !== 'undefined') {
|
||||
// detect browser, add to class for conditional styling
|
||||
import('./pwa.js')
|
||||
|
||||
const browser = navigator.userAgent.toLowerCase()
|
||||
if (browser.includes('chrome'))
|
||||
document.documentElement.classList.add('browser-chrome')
|
||||
|
||||
3
.vitepress/theme/pwa.js
Normal file
3
.vitepress/theme/pwa.js
Normal file
@@ -0,0 +1,3 @@
|
||||
import { registerSW } from 'virtual:pwa-register'
|
||||
|
||||
registerSW({ immediate: true })
|
||||
Reference in New Issue
Block a user