-
Notifications
You must be signed in to change notification settings - Fork 57
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
Wait for DOM content before snapping #24
Comments
Thanks for the feedback! As it is, there isn't a whole lot of support for this. There is As I see it, there are two features that may solve this problem:
The first is fairly easy to implement and I'll try to do it on the next release. The second use case is more limited and requires more rewriting, so I'm not sure if I want to support that quite yet. |
I now have a better implementation of this here. |
For my use case I too need to signal from JavaScript running on the page when to both start and stop the capture. I looked at hooking into a window.stopCapture() call (and a startCapture to be implemented) as in PR 56 #56 but @Asheboy 's captureWhileSelectorExists (https://github.com/Asheboy/timesnap/blob/master/index.js#L197-L205) looks cleaner as it doesn't pollute the global namespace. @tungs what do you think? |
@RhinoW, I'm on the fence about this, though I'm leaning towards the overall idea; the implementation seems straightforward and generally useful, though it feels a little feature bloaty. If I do implement it, it would probably be as two functions: a start function (like This should give you the flexibility to check for a range of things (e.g. see if an element exists or a global variable is set to a certain value). Would this work for your use case? I realize that this would require specifying a function instead of a string, so it can be less friendly than Asheboy's implementation. |
hey @tungs thanks for a very cool library |
It would be great if it was possible to only start taking the screenshots once some specific content was on the DOM. Puppeteer has a
waitForSelector
function (docs), however I've not had success implementing this, I imagine this is because the content I am waiting for is rendered by JS.The text was updated successfully, but these errors were encountered: