-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Random glitch when capturing screenshot #964
Comments
This is (kind of) by design - using I wonder if the /cc @Mr0grog, as he is way closer to this than I am, and might have more ideas. |
I unfortunately can’t think of a reliable way to do this, BUT… we I think we could hold the callback until after the |
I'm kind new to this topic but what about using |
That approach was thrown out because it comes with a whole host of other issues and downsides (if your goal is solely to make screenshots of webpages, it’s great; otherwise it may not work well at all). There wasn’t much discussion of it, so no worries for not knowing about it. |
Hey guys – do you mind catching me up on this issue a bit? It seems like the frame manager was added to address out-of-date frames. Is that still an issue on electron's side? And do you have any example scripts I can try out that would illustrate this problem? |
If it helps, here’s a version of @ri0ter’s link from the initial post that has the highlight in the correct place: https://github.com/segmentio/nightmare/blob/dbb1b6413389eb551b9bc361d66b316172f4dbb8/lib/frame-manager.js#L102-L106 The frame manager works by highlighting and unhighlighting a portion of the page (in the top left corner) to force a frame (in animation terms, not geometry terms) to be rendered, which ensures that the frame buffer in the browser process (not renderer process, which is already good) is up-to-date. Unfortunately, the frame manager signals that its done its job after sending the command to hide the highlight, but not before waiting for a frame where the highlight is hidden. So sometimes the frame you get in the captured screenshot has the highlight, which is the pixel @ri0ter is talking about. As noted before, the fix described in my first commment on #955 is the solution to this problem (short of fixing Electron so that calls to capture the page always have an up-to-date frame buffer, which was a hard problem a year ago—not sure if Chromium internals have changed enough to make that easier now). |
Sometimes when using screenshot method in top left corner a small dot is visible on captured image.
After a short research I found out that a call to
DOM.highlightRect
command here causes the problem.The text was updated successfully, but these errors were encountered: