Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for "networkidle2" #5

Open
rjyo opened this issue Dec 19, 2018 · 3 comments
Open

Support for "networkidle2" #5

rjyo opened this issue Dec 19, 2018 · 3 comments

Comments

@rjyo
Copy link

rjyo commented Dec 19, 2018

Most SPAs will use async data and currently rendora only supports waitAfterDOMLoad: milliseconds.

Wait a fixed time is not good enough at most times. Is it possible to add an option like puppeteer's

await page.goto('https://news.ycombinator.com', {waitUntil: 'networkidle2'});
@geokb
Copy link
Member

geokb commented Dec 19, 2018

I think I might do that if there is enough interest, the problem is that networkidle2 isn't really based on anything in the chrome-devtools-protocol itself, it's just a heuristic made by puppeteer, and they still impose a safeguard interval of 500ms after the last 2 requests as far as I am aware for the case of networkidle2. On the other hand, setting a "large enough" value of waitAfterDOMLoad according to your application does the same thing in the end. Anyway I'll have a look at the implementation of puppeteer and try to use it here. Probably I'll have to add waitUntil under the headless configuration namespace that will override waitAfterDOMLoad

@kapouer
Copy link

kapouer commented Jan 2, 2019

You could inject a script that hooks into:

  • setTimeout if it has a small value
  • xhr, fetch
  • <script>
  • promise
  • raf
  • window, document loading events

to determine when page has done all interesting things.
I'm doing that right there but it's really specific to this engine.

@wpajqz
Copy link

wpajqz commented Jan 25, 2019

I think it's ok
wpajqz@15adfdf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants