Last active
February 26, 2022 10:29
-
-
Save sigmaSd/046cf7e6522887c8632e4ff7f14f96a7 to your computer and use it in GitHub Desktop.
deno run --no-check -A https://gist.githubusercontent.com/sigmaSd/046cf7e6522887c8632e4ff7f14f96a7/raw/5abd19c0ab2b583e15bcbe1b9cf4e4a1e8deee00/DenoChromeRepl.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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