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 leaf = (txt) => { for (const el of document.querySelectorAll('*')) if (el.children.length===0 && (el.textContent||'').trim()===txt) return el; return null; }; const top = leaf('布线'); if (!top) return {err:'no 布线 menu'}; fire(top); await sleep(900); const items = []; for (const el of document.querySelectorAll('li,[role="menuitem"],div')) { if (el.children.length===0) continue; const t = (el.innerText||'').trim(); if (t && t.length < 40 && el.offsetParent !== null) items.push(t); } const uniq = [...new Set(items)].filter(s => s.indexOf('\n') < 0); return {items: uniq.slice(0, 80)};