Skip to content
This repository has been archived by the owner. It is now read-only.

Chrome prototype: work around "save visible" captureVisibleTab delay #4300

Closed
jaredhirsch opened this issue Apr 3, 2018 · 2 comments
Closed

Chrome prototype: work around "save visible" captureVisibleTab delay #4300

jaredhirsch opened this issue Apr 3, 2018 · 2 comments
Assignees

Comments

@jaredhirsch
Copy link
Member

@jaredhirsch jaredhirsch commented Apr 3, 2018

On Chrome, the "save visible" captured image sometimes includes the selection overlay. The problem is more pronounced on heavyweight pages, like The Verge.

So far, I've tried:

  • switching from toggling display to toggling visibility (helped but not enough)
  • toggling visibility and accessing DOM properties of the iframe that should cause a DOM refresh (e.g., checking its offsetWidth) and then checking the visibility is 'hidden' before taking a shot
  • toggling visibility, waiting for requestAnimationFrame or a setTimeout inside a Promise, then checking the DOM state and resolving the Promise only when the DOM says the iframe is hidden

It seems there are competing rendering asynchronicities at work, but I'm not sure we have anything that can tell us when the iframe is gone from the DOM.

One option might be to explore the Intersection observer API.

Another option: screenshot the page before displaying the preselection iframe, though this might introduce its own issues.

@jaredhirsch
Copy link
Member Author

@jaredhirsch jaredhirsch commented Apr 3, 2018

Refs #3998

@jaredhirsch
Copy link
Member Author

@jaredhirsch jaredhirsch commented May 3, 2018

Ian's working on this, too

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

Successfully merging a pull request may close this issue.

None yet
4 participants