if (!window.__arLog) { window.__arLog = []; const push = (k, a) => { try { window.__arLog.push(k+': '+Array.from(a).map(x=>{ try { return typeof x==='string'? x : JSON.stringify(x); } catch(e){ return String(x); } }).join(' ').slice(0,300)); } catch(e){} }; ['log','warn','error','info'].forEach(k=>{ const o=console[k].bind(console); console[k]=function(){ push(k, arguments); return o.apply(console, arguments); }; }); window.addEventListener('error', e=>window.__arLog.push('winerr: '+e.message)); window.addEventListener('unhandledrejection', e=>window.__arLog.push('rej: '+String(e.reason).slice(0,300))); const of = window.fetch; window.fetch = function(){ try{ window.__arLog.push('fetch: '+String(arguments[0]).slice(0,200)); }catch(e){} return of.apply(this, arguments); }; const ox = XMLHttpRequest.prototype.open; XMLHttpRequest.prototype.open = function(m,u){ try{ window.__arLog.push('xhr: '+m+' '+String(u).slice(0,200)); }catch(e){} return ox.apply(this, arguments); }; const ow = window.Worker; if (ow) { window.Worker = function(u, o){ try{ window.__arLog.push('worker: '+String(u).slice(0,200)); }catch(e){} return new ow(u, o); }; window.Worker.prototype = ow.prototype; } } window.__arLog.length = 0; return {hooked: true};