1 line
606 B
JavaScript
1 line
606 B
JavaScript
const pw=require("playwright");(async()=>{const b=await pw.chromium.launch();const pg=await b.newPage();await pg.setViewportSize({width:1440,height:900});await pg.goto("http://localhost:3333");await pg.waitForTimeout(3000);const info=await pg.evaluate(()=>{return{hasSw:typeof window.sw,totalGps:document.querySelectorAll(".gp").length,showGps:document.querySelectorAll(".gp.show").length,gpWidths:Array.from(document.querySelectorAll(".gp")).map(g=>({t:g.dataset.t,w:g.offsetWidth,h:g.offsetHeight}))}});console.log(JSON.stringify(info,null,2));await b.close()})().catch(e=>console.log("err:",e.message)); |