import{c as u}from"./logger-CvfM-6aa.js";const r=u("ToutiaoCS");chrome.runtime.onMessage.addListener((c,d,o)=>{if(c.type==="TOUTIAO_PAGE_FETCH"){const{url:s,options:n}=c.payload;return r.debug("Received fetch request:",s),fetch(s,{...n,credentials:"include"}).then(async e=>{const a=await e.text();let t;try{t=JSON.parse(a)}catch{t=a}r.debug("Fetch response:",t),o({success:!0,data:t})}).catch(e=>{r.error("Fetch error:",e),o({success:!1,error:e.message})}),!0}});r.debug("Toutiao content script loaded");
