2 lines
1.1 KiB
JavaScript
2 lines
1.1 KiB
JavaScript
try{setTimeout(function(){try{var a=document.getElementById("ls-ag");if(a&&typeof AG!=="undefined")a.textContent=AG.length;var d=document.getElementById("ls-dp");if(d&&typeof DP!=="undefined")d.textContent=DP.length}catch(x){}try{var r=new XMLHttpRequest();r.open("GET","/api/nonreg-api.php",true);r.onload=function(){try{var j=JSON.parse(r.responseText);var e=document.getElementById("ls-nr");if(e)e.textContent=j.pass+"/"+j.total}catch(z){}};r.send()}catch(y){}},2000)}catch(w){}(function(){var _f=window.fetch;window.fetch=async function(u,o){try{var r=await _f(u,o);if(typeof u==="string"&&u.includes("/api/")&&!u.endsWith(".js")&&!u.endsWith(".json")){var ct=r.headers.get("content-type")||"";if(ct.includes("text/html")&&r.status>=400){return new Response(JSON.stringify({error:"server_recovering",message:"Retry in 10s",code:r.status}),{status:503,headers:{"Content-Type":"application/json"}})}}return r}catch(e){if(typeof u==="string"&&u.includes("/api/")){return new Response(JSON.stringify({error:"network",message:e.message}),{status:503,headers:{"Content-Type":"application/json"}})}throw e}}})()
|