JezK
Edit File: ifpwap-register-sw.js
const swfile = 'https://www.postofday.com/ifpwap-sw.js'; const scopePath = 'https://www.postofday.com/'; if ('serviceWorker' in navigator) { window.addEventListener('load', () => { navigator.serviceWorker.register(swfile, { scope: scopePath }) .then(registration => { console.log('ServiceWorker ready'); console.log('ServiceWorker scope:', registration.scope); if (registration.active) { registration.update(); } }) .catch(error => console.log('Registration failed with ' + error)); }); } window.addEventListener('load', () => { const manifestLink = document.querySelectorAll("link[rel='manifest']"); if (manifestLink.length > 1) { for (let i = 0; i < manifestLink.length; i++) { const href = manifestLink[i].getAttribute("href"); if (href.indexOf("ifpwap-manifest.json") === -1) { manifestLink[i].remove(); } } } const ua = window.navigator.userAgent; const iOS = ua.match(/iPad|iPod|iPhone/); const webkit = ua.match(/WebKit/i); const iOSSafari = iOS && webkit && !ua.match(/CriOS/i); if (iOSSafari && window.matchMedia('(display-mode: standalone)').matches) { setTimeout(() => { const anchorFix = document.querySelectorAll("a[href='#']"); if (anchorFix.length > 1) { for (let i = 0; i < anchorFix.length; i++) { anchorFix[i].setAttribute("href", "javascript:void(0);"); } } }, 600); } });