Solution of infinite loading when adding some fonts in html which are located in Internet
Hello there,
Problem
When you add some fonts which are located in internet, puppeteer have infinite load issue. To avoid this, you have forget an option to put at moment to setContent which allow to wait until all ressources are loaded. Indeed in printer.js you set the content of html like that: page.setContent(html)
while they are some options to wait the loaded of ressources.
Solution:
I see the same issue in puppeteer repo https://github.com/puppeteer/puppeteer/issues/728#issuecomment-334301491
setContent have not only the html content param but also an second which is the option. Inside option they are waitUntil :
paged.setContent(html, { waitUntil: 'networkidle0' })
waitUntil: 'networkidle0'
allow to wait until they are no request which are sent after an certain duration
I made that in my project, and that's resolve this issue