1
0
mirror of https://github.com/cotes2020/jekyll-theme-chirpy.git synced 2025-12-18 05:41:31 +00:00

feat: add option to turn off PWA (#527)

This commit is contained in:
Cotes Chung
2022-06-05 00:10:20 +08:00
parent d127183b97
commit 106c981bac
4 changed files with 35 additions and 14 deletions

View File

@@ -0,0 +1,12 @@
---
layout: compress
permalink: '/unregister.js'
---
if ('serviceWorker' in navigator) {
navigator.serviceWorker.getRegistrations().then((registrations) => {
for (let reg of registrations) {
reg.unregister();
}
});
}