import { chromium } from 'playwright'; const b = await chromium.launch(); const ctx = await b.newContext({ viewport:{width:1280,height:900} }); const p = await ctx.newPage(); const cdp = await ctx.newCDPSession(p); await cdp.send('Network.enable'); await cdp.send('Network.setCacheDisabled', { cacheDisabled: true }); await cdp.send('Network.emulateNetworkConditions', { offline:false, latency:120, downloadThroughput: 120*1024*8, uploadThroughput: 60*1024*8 }); p.goto('https://www.novalon.cn/about', { waitUntil:'commit', timeout:90000 }).catch(()=>{}); for (const wait of [900, 1500, 3000]) { await p.waitForTimeout(wait === 900 ? 900 : wait - 900); const snap = await p.evaluate(() => { const h1 = document.querySelector('h1'); const chain = []; let el = h1; while (el) { chain.push(`${el.tagName}${el.className?'.'+String(el.className).split(' ')[0]:''} op=${getComputedStyle(el).opacity}`); el = el.parentElement; } const zeros = [...document.querySelectorAll('body *')].filter(e => parseFloat(getComputedStyle(e).opacity) === 0) .slice(0,8).map(e => ({ tag:e.tagName, cls:String(e.className).slice(0,46), text:(e.innerText||'').slice(0,16) })); return { t: Math.round(performance.now()), h1op: h1 ? getComputedStyle(h1).opacity : null, chain: chain.slice(0,9), zeros }; }).catch(()=>null); console.log('@'+wait+'ms', JSON.stringify(snap)); } await b.close();