const sleep=ms=>new Promise(r=>setTimeout(r,ms)); const propsOf = el => { for (const k of Object.keys(el)) if (k.startsWith('__reactProps$')) return el[k]; return null; }; const fire = (el) => { let t = el; for (let i=0;i<8&&t;i++){const q=propsOf(t); if(q&&typeof q.onClick==='function'){q.onClick({target:t,currentTarget:t,stopPropagation(){},preventDefault(){},nativeEvent:{},button:0,detail:1});return true;} t=t.parentElement;} return false; }; const fsOf = () => Array.from(document.querySelectorAll('fieldset')).find(x=>(x.querySelector('legend')||{}).textContent==='忽略网络'); const DROP = ['USB1_DP','USB1_DM','USB2_DP','USB2_DM','USB3_DP','USB3_DM','USB4_DP','USB4_DM','USB5_DP','USB5_DM','UP_DP','UP_DM','USB_DP','USB_DM']; const done=[], fail=[]; for (const name of DROP) { const fs = fsOf(); if(!fs) return {err:'gone'}; const tr = Array.from(fs.querySelectorAll('tr')).find(t=>{ const c = t.querySelector('td[data-col-key="net"] span'); return c && c.textContent.trim()===name; }); if(!tr){ fail.push(name+':norow'); continue; } const del = tr.querySelector('td[data-col-key="delete"]'); const target = del.querySelector('i,svg,span,button') || del; if (fire(target)) done.push(name); else fail.push(name+':nofire'); await sleep(250); } const fs = fsOf(); return {done, fail, table: (fs.innerText||'').trim().replace(/\s+/g,' ')};