mirror of
https://github.com/Brandon-Rozek/website-theme.git
synced 2024-11-09 19:00:34 -05:00
13 lines
345 B
JavaScript
13 lines
345 B
JavaScript
|
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"});
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
|