mirror of
https://github.com/Brandon-Rozek/website-theme.git
synced 2025-10-09 10:11:14 +00:00
Cleaned up JS scripts and added service worker
This commit is contained in:
parent
1f1e07b4bf
commit
5214da544e
7 changed files with 125 additions and 16 deletions
12
assets/js/script.js
Normal file
12
assets/js/script.js
Normal file
|
@ -0,0 +1,12 @@
|
|||
if (navigator && navigator.serviceWorker) {
|
||||
navigator.serviceWorker.register('/serviceworker.js', {
|
||||
scope: '/'
|
||||
});
|
||||
|
||||
window.addEventListener("load", function() {
|
||||
if (navigator.serviceWorker.controller != null) {
|
||||
navigator.serviceWorker.controller.postMessage({"command":"trimCache"});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue