Files
vscode-workbench/login-templates/v4-showcase/debug5.js
T

1 line
590 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 r=await pg.evaluate(()=>{return{hasSw:typeof sw,scriptTags:document.querySelectorAll("script").length,bodyLen:document.body.innerHTML.length,scriptContent:document.querySelector("script")?document.querySelector("script").textContent.substring(0,100):"none"}});console.log("result:",JSON.stringify(r));await b.close()})().catch(e=>console.log("err:",e.message));