22 lines
1.1 KiB
JavaScript
22 lines
1.1 KiB
JavaScript
import puppeteer from 'puppeteer';
|
|
const b = await puppeteer.launch({ args:['--no-sandbox','--disable-setuid-sandbox','--use-gl=angle','--enable-unsafe-swiftshader','--ignore-gpu-blocklist'] });
|
|
const p = await b.newPage();
|
|
const errs=[]; p.on('pageerror',e=>errs.push(e.message)); p.on('console',m=>{if(m.type()==='error')errs.push(m.text());});
|
|
await p.setViewport({width:1100,height:1500});
|
|
await p.goto('http://10.200.201.3:4175/',{waitUntil:'load',timeout:60000});
|
|
await new Promise(r=>setTimeout(r,800));
|
|
const r = await p.evaluate(()=>{
|
|
const pick = (sel)=>{ const el=document.querySelector(sel); if(!el) return null;
|
|
const cs=getComputedStyle(el);
|
|
return { boxShadow: cs.boxShadow.slice(0,60), shadowLen: cs.boxShadow.length, transform: cs.transform, bg: cs.backgroundImage.slice(0,40) }; };
|
|
return {
|
|
mp: pick('.mp-card'),
|
|
portfolio: pick('.portfolio-card'),
|
|
skill: pick('.skill-task-card'),
|
|
theme: document.documentElement.getAttribute('data-theme'),
|
|
};
|
|
});
|
|
console.log(JSON.stringify(r,null,1));
|
|
console.log('ERRS', errs.slice(0,6));
|
|
await b.close();
|