PWA: service worker
This commit is contained in:
parent
0f81740562
commit
1d5f73e2ab
2
app/sw.pwa.js
Normal file
2
app/sw.pwa.js
Normal file
|
@ -0,0 +1,2 @@
|
|||
//PWA用
|
||||
self.addEventListener('fetch', function(e) {})
|
|
@ -139,7 +139,7 @@ function main(ver, basefile, pwa) {
|
|||
source = source.replace(/@@lang@@/g, lang)
|
||||
source = source.replace(/@@langlist@@/g, langstr)
|
||||
if(pwa) {
|
||||
source = source.replace(/@@pwa@@/g, '<script>var pwa = true;</script>')
|
||||
source = source.replace(/@@pwa@@/g, `<script>var pwa = true;"serviceWorker"in navigator&&navigator.serviceWorker.register("/sw.pwa.js").then(e=>{});</script>`)
|
||||
source = source.replace(/@@node_base@@/g, 'dependencies')
|
||||
} else {
|
||||
source = source.replace(/@@pwa@@/g, '<script>var pwa = false;</script>')
|
||||
|
|
Loading…
Reference in New Issue
Block a user