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

Screenshots timing out #955

Closed
twolfson opened this issue Jan 12, 2017 · 16 comments
Closed

Screenshots timing out #955

twolfson opened this issue Jan 12, 2017 · 16 comments

Comments

@twolfson
Copy link
Contributor

In a recent Nightmare script, I was consistently getting timeouts occurring and wound up writing #945 to resolve timeouts not cleaning up after themselves properly. This issue is mostly for @Mr0grog so they can debug issues on triggering frames in the said script. I made a minimal example here:

https://gist.github.com/twolfson/b666177b87ae339f3ab2183c2be77690

Things I noticed:

  • Removing the wait(100) will cause it to start passing
  • Removing 1 screenshot call will cause it to start passing
  • Moving from getbootstrap.com to google.com will cause it to start passing

Best of luck on your debugging!

/cc @Mr0grog

@Mr0grog
Copy link
Contributor

Mr0grog commented Jan 20, 2017

OK! Sorry I let this fall off my radar. #964 reminded me of it—and it turns out this issue and that one are related!

It appears to be possible that the DOM.highlightRect and DOM.hideHighlight debugger calls can happen in rapid enough succession that no frames are generated (both operations happen before generating a frame, so nothing has “changed” visually, and so no frame is rendered).

There also seems to be an issue where the synchronous call to detach the debugger immediately after the DOM.hideHighlight call prevents the hideHighlight operation from ever running—so on the second screenshot, the call to DOM.highlightRect isn’t actually changing anything.

Anyway, I think the solution to both this and #964 is to:

  1. Call DOM.highlightRect
  2. Wait for a frame
  3. Call DOM.hideHighlight
  4. Wait for a frame
  5. Detach the debugger
  6. Dispatch a data event from FrameManager

This will probably be easiest if I wait for #945 to be complete, since it’ll be messing around in the same area of the codebase.

@FredrikNoren
Copy link
Contributor

Experiencing the same issue here

@entrptaher
Copy link
Contributor

entrptaher commented Apr 12, 2017

Calling screenshot function multiple times resulted in this problem.

image

Related Issue: #555

@chunsli
Copy link

chunsli commented May 2, 2017

Bumping this up! Experiencing the same issue as well! Thanks guys!

@lokidokicoki
Copy link

bump! same issue

@ucjonathan
Copy link

bump, same issue

@Mr0grog
Copy link
Contributor

Mr0grog commented Aug 11, 2017

Y'all should probably be bumping #945 since this depends on that.

@Mr0grog
Copy link
Contributor

Mr0grog commented Sep 1, 2017

@casesandberg would you like to see a PR for this now that #945 is merged, or is this pretty much being left alone now that you are moving towards headless Chrome?

@Howardwlo
Copy link

@Mr0grog I'm running into this issue and I'd love to get the PR :). What's this about headless Chrome?

@Mr0grog
Copy link
Contributor

Mr0grog commented Oct 9, 2017

The Segment folks are rewriting this library to use Chrome (headless) and not Electron, so the way a lot of stuff like this that heavily depends on the API for controlling the browser will have to be completely different.

@Howardwlo
Copy link

@Mr0grog Oohhh. Are there updates about the switch to Chrome somewhere?

@Mr0grog
Copy link
Contributor

Mr0grog commented Oct 11, 2017

I think it’s on the v3 branch. I don’t know any details beyond what I’ve already stated, which was what @casesandberg told me in a reply on another issue (lost track of it now).

@matthewmueller
Copy link
Contributor

matthewmueller commented Feb 21, 2018

Hey folks, we're going to stick with electron for now since puppeteer is already a great option for headless chrome.

I'm assuming the merged PR resolved this issue, so I'm going to close. If it's still a problem, please reopen with what's still not working – thanks!

@Mr0grog
Copy link
Contributor

Mr0grog commented Feb 21, 2018

If the merged PR you are referencing is #945, it does not solve this issue (though it was blocking the solution/the work for this issue).

@c-vetter
Copy link

c-vetter commented Mar 8, 2018

@matthewmueller @Mr0grog
Is this fixed, or should it be reopened?

@Mr0grog
Copy link
Contributor

Mr0grog commented Mar 8, 2018

No change from my previous comment—unless the code in frame-manager.js has been changed (and it does not appear to have been), then no, this is not fixed.

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

No branches or pull requests