(async ()=>{ const mod = await import('puppeteer') const puppeteer = (mod && mod.default) ? mod.default : mod const chromePath = process.env.CHROME_PATH || '/usr/bin/chromium' const url = process.env.VITE_BROADCASTPANEL_URL || 'https://avanzacast-broadcastpanel.bfzqqk.easypanel.host' console.log('launching', chromePath) const browser = await puppeteer.launch({ executablePath: chromePath, args: ['--no-sandbox','--disable-setuid-sandbox','--disable-dev-shm-usage'], defaultViewport: { width: 1400, height: 900 } }) const page = await browser.newPage() try { await page.goto(url, { waitUntil: 'networkidle2', timeout: 60000 }) } catch(e) { console.warn('goto error', e && e.message ? e.message : e) } await page.waitForTimeout(3000) await page.screenshot({ path: 'elements-screenshot.png', fullPage: true }) const buttons = await page.evaluate(()=>{ const nodes = Array.from(document.querySelectorAll('button, a, [role="button"], [aria-label]')) return nodes.slice(0,200).map(n=>({ text: (n.textContent||n.innerText||'').trim().slice(0,100), role: n.getAttribute && n.getAttribute('role'), aria: n.getAttribute && n.getAttribute('aria-label'), classes: (n.className||'').toString().slice(0,200) })) }) console.log('buttons:', buttons.length) for (let i=0;i{ console.error(e && e.stack?e.stack:e); process.exit(2) })