caching service worker
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
let sAlert = window.parent.sAlert;
|
||||
|
||||
|
||||
function setBackground() {
|
||||
let randomNumbers = [100-Math.abs(Math.floor(Math.random() * 200) - 99), 100-Math.abs(Math.floor(Math.random() * 200) - 99)];
|
||||
document.body.style.setProperty("--gradient-x", randomNumbers[0] + "%");
|
||||
@ -54,6 +55,9 @@ function setTheme(arg) {
|
||||
`)
|
||||
}
|
||||
document.addEventListener("DOMContentLoaded", ()=>{
|
||||
if("serviceWorker" in navigator) {
|
||||
navigator.serviceWorker.register("/sw.js", { scope: '/' });
|
||||
}
|
||||
if(!(localStorage.getItem("selenite.fast-mode") == 'true')) {
|
||||
setBackground();
|
||||
loadPJS();
|
||||
|
||||
Reference in New Issue
Block a user