Skip to content
This repository has been archived by the owner on Nov 24, 2018. It is now read-only.

fix: load event not fired when page load very fast (fix #277, #297) #400

Merged
merged 2 commits into from
May 12, 2018

Conversation

zaaack
Copy link
Contributor

@zaaack zaaack commented Feb 6, 2018

Chromeless is awesome! It's much easier to use compare to puppeteer / chromedriver.

But I found it might be stuck when the page is loaded very fast. According to examples in chrome-remote-interface's README, it might be caused by register load event callback after Page.navigate, because the page could be already loaded if a page is loaded very fast. I tested in my case, the fast page load event is fired with this patch.

Also, we cannot set a timeout for page load event, so I added an optional timeout parameter in goto method.

Here are some relevant issues:
#277
#297

@codecov-io
Copy link

Codecov Report

Merging #400 into master will increase coverage by 1.11%.
The diff coverage is 85.18%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #400      +/-   ##
==========================================
+ Coverage   38.03%   39.14%   +1.11%     
==========================================
  Files           7        7              
  Lines         844      866      +22     
  Branches      116      121       +5     
==========================================
+ Hits          321      339      +18     
- Misses        523      527       +4
Impacted Files Coverage Δ
src/api.ts 47.71% <100%> (ø) ⬆️
src/chrome/local-runtime.ts 27.27% <100%> (+0.83%) ⬆️
src/util.ts 43.97% <78.94%> (+2.52%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fcdc8dc...221ef45. Read the comment docs.

@adieuadieu adieuadieu self-requested a review March 9, 2018 21:51
@adieuadieu adieuadieu merged commit 978fd2e into schickling:master May 12, 2018
@felixfbecker
Copy link
Contributor

🎉 This PR is included in version 1.5.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

4 participants