Skip to content

Commit

Permalink
Display console output from the page to the terminal
Browse files Browse the repository at this point in the history
  • Loading branch information
dtinth committed Sep 19, 2019
1 parent 1869adf commit 10f64c6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions render.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ function createRendererFactory(url, { scale = 1 } = {}) {
const promise = (async () => {
const browser = await puppeteer.launch()
const page = await browser.newPage()
await page.goto(url)
const info = await page.evaluate(`({
page.on('console', msg => console.log('PAGE LOG:', msg.text()));
page.on('pageerror', msg => console.log('PAGE ERROR:', msg));
await page.goto(url, { waitUntil: 'load' })
width: document.querySelector('#scene').offsetWidth,
height: document.querySelector('#scene').offsetHeight,
...getInfo(),
Expand Down

0 comments on commit 10f64c6

Please sign in to comment.