← Back
import { chromium } from 'playwright';
const b = await chromium.launch({ executablePath:'/usr/bin/chromium-browser', args:['--no-sandbox'] });
const ctx = await b.newContext({ viewport:{ width:390, height:1300 }, deviceScaleFactor:1.5, serviceWorkers:'block' });
await ctx.addInitScript(()=>{ localStorage.setItem('sz_theme','dark'); localStorage.setItem('sz_accent','green'); });
const p = await ctx.newPage();
await p.goto('https://poly-dev.szhub.space/portfolio', { waitUntil:'domcontentloaded', timeout:35000 });
await p.waitForTimeout(5500);
const hasPk = await p.evaluate(()=>!!document.querySelector('.pk-portfolio'));
const title = await p.evaluate(()=>{const e=document.querySelector('.pk-portfolio .portfolio-title'); return e?getComputedStyle(e).fontFamily:'none';});
const txt = await p.evaluate(()=>document.body.innerText.replace(/\n+/g,' ').slice(0,150));
await p.screenshot({ path:'_pf.png' });
console.log('pk-portfolio:', hasPk, '| title font:', title);
console.log('text:', JSON.stringify(txt));
await b.close();