install-worker.html (439B)
1 <!DOCTYPE html> 2 <html> 3 <body> 4 <p>Loading...</p> 5 <script> 6 async function install() { 7 let script; 8 for (const q of location.search.slice(1).split('&')) { 9 if (q.split('=')[0] === 'script') { 10 script = q.split('=')[1]; 11 } 12 } 13 const scope = location.href; 14 const reg = await navigator.serviceWorker.register(script, {scope}); 15 await navigator.serviceWorker.ready; 16 location.reload(); 17 } 18 19 install(); 20 </script> 21 </body> 22 </html>