Skip to content

Instantly share code, notes, and snippets.

@sigmaSd
Last active February 26, 2022 10:29
Show Gist options
  • Save sigmaSd/046cf7e6522887c8632e4ff7f14f96a7 to your computer and use it in GitHub Desktop.
Save sigmaSd/046cf7e6522887c8632e4ff7f14f96a7 to your computer and use it in GitHub Desktop.
import puppeteer from "https://deno.land/x/[email protected]/mod.ts";
const cliRepl = Deno.run({
cmd: ["deno", "repl", "--unstable", "--inspect"],
});
const browser = await puppeteer.launch({ headless: false });
const page = (await browser.pages())[0];
await page.goto(
`chrome://inspect`,
);
await page.waitForFunction(() => {
if (
document.body.innerText.includes("inspect")
) {
return true;
}
});
await page.evaluate(() => {
document.querySelectorAll("span")[2].click();
});
await page.close();
await cliRepl.status();
browser.close();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment