'+CARD+''; // Why it fired, readable from devtools on a page that has no other trace. h.setAttribute('data-fanon-blanked',lastReason||'unknown'); var b=h.querySelector('[data-fanon-reload]'); if(b){b.addEventListener('click',function(){location.reload();});} }catch(e){}} // One guarded reload per 10 minutes: a fresh document genuinely fixes a torn // down React root or a stale chunk set, but a second break that soon is not // worth another automatic reload — show the card and let the user decide. function trigger(reason){try{ if(fired)return; fired=true; var last=0; try{last=Number(sessionStorage.getItem(KEY))||0;}catch(e){} var now=Date.now(); if(!last||now-last>RELOAD_WINDOW_MS){ try{sessionStorage.setItem(KEY,String(now));}catch(e){} report(reason,0); location.reload(); return; } report(reason,1); paint(); }catch(e){}} // 1. Next's builtin error page. Load-bearing and checked in its own right: // that tree's body.innerText is NON-empty (it holds the unreadable // "Application error" line), so the emptiness probe below never sees it. function checkNextError(){if(document.documentElement.id==='__next_error__'){trigger('next_error');return true;}return false;} try{ new MutationObserver(checkNextError).observe(document.documentElement,{attributes:true,attributeFilter:['id']}); }catch(e){} // 2. Stylesheet never arrived (chunk 404 / stale edge-cached document). // Registered from the inline script so it catches failures that fire long // before hydration would have been able to listen. window.addEventListener('error',function(ev){try{ var t=ev&&ev.target; if(t&&t.tagName==='LINK'&&t.rel==='stylesheet'){trigger('dead_stylesheet');} }catch(e){}},true); // 3. Emptiness backstop: the root was cleared outright. function isBlank(){try{ var b=document.body; if(!b)return true; if(b.children.length===0)return true; if((b.innerText||'').trim()==='')return !b.querySelector('img,svg,canvas,video'); return false; }catch(e){return false;}} function sweep(){try{ if(checkNextError())return; if(document.styleSheets.length===0){trigger('dead_stylesheet');return;} if(isBlank()){trigger('empty_body');} }catch(e){}} window.addEventListener('load',function(){setTimeout(sweep,0);}); // Most uncaught errors (Load failed, AbortError, LockManager rejections) do // NOT blank the page, so an error only prompts a re-check — never a trigger. window.addEventListener('error',function(){setTimeout(sweep,1200);}); window.addEventListener('unhandledrejection',function(){setTimeout(sweep,1200);}); }catch(e){}})();
My Heroes are lowkey insane | Fanon