Skip to content
This repository has been archived by the owner on Apr 7, 2020. It is now read-only.

Refactor waitForText to use HTML body (allows to wait for non-visual text) #49

Open
msl-kabo opened this issue Jul 9, 2017 · 3 comments

Comments

@msl-kabo
Copy link

msl-kabo commented Jul 9, 2017

I've got a page with an animation on it, and want to generate a PDF of the page after the animation has finished. I can't use waitForText with a text that's on the page because that generates a PDF from before the animation. So I tried setting a timeout for when the animation should be done that renders a text with style display: none. That text doesn't seem to get picked up though. I tried display: hidden but that text got visibly rendered unfortunately.

Could we please have waitForText detect text with display: none (or some other solution that achieves the goal of triggering the pdf render without being visible on the pdf)?

@msl-kabo
Copy link
Author

msl-kabo commented Jul 9, 2017

I meant visibility: hidden, not display: hidden

@msl-kabo
Copy link
Author

msl-kabo commented Jul 9, 2017

<div style="font-size: 0px; margin: 0px; padding: 0px;">PdfOkToGo</div> seems to work though.

@msokk
Copy link
Owner

msokk commented Jul 11, 2017

Hi,

waitForText uses browsers find in page functionality, so unfortunately it currently only detects visible text (opacity: 0 works too).

document.body.innerText behaves the same, so using that is off the table.
Would have to rewrite it going through innerHTML.

@msokk msokk changed the title waitForText doesn't seem to work with display: none Refactor waitForText to use HTML body (allows to wait for non-visual text) Aug 24, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants