How to know if page has finished rendering using Remote debugging protocol.

585 views
Skip to first unread message

saty...@media.net

unread,
Jun 21, 2017, 7:06:32 AM6/21/17
to Google Chrome Developer Tools
Hi,
I am using Emulation api of remote debugging protocol through nodejs library to resize my viewport and take screenshot. 
     
     var callback = function () {
          //screen capture call and event catch
     }
     Emulation.setVisibleSize({width: x, height: y}, callback);

But some webpages are not completely rendered at the time of taking screenshot and I get some incomplete image of the page . I have made sure that both Page.domContentEventFired and Page.loadEventFired
 are fired so, all network transaction must be over. I think may be resizing the viewport somehow leads to re-rendering of the page.

I want to take screenshots of the page in different viewport sizes, using remote debugging protocol, is there anyway I can tell if the page is ready to be viewed(i.e ready for the screenshot) after emulation is performed. 

Thanks, in advance. Hope to hear something soon.

Satyam.

Blaise Bruer

unread,
Jun 21, 2017, 2:01:57 PM6/21/17
to google-chrome-...@googlegroups.com
domContentEventFired and loadEventFired does not mean that the network requests are done.

One thing that might help is to keep track of network requests and wait until all of them are done, failed or redirected.

@paulirish might be able to help a little more with some of the other metrics that projects like lighthouse uses, but I think you'd need to code them yourself. 

--
You received this message because you are subscribed to the Google Groups "Google Chrome Developer Tools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-chrome-develo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-chrome-developer-tools/b5c54892-7517-468d-98fc-1b7f11904fe2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages