Closed RhinoW closed 3 years ago
Thanks for filing this. I like the idea of being able to stop capturing from the captured web page. There seem to be some minor issues (like typos), but my biggest concern is polluting the global namespace, so I'd prefer to use something more specific and less likely to conflict than window.stopCapture
. I'll think about it this week.
This may be a better way to handle - https://github.com/tungs/timesnap/issues/24 - a captureWhileSelectorExists option.
Decision between
After mulling over the idea of polluting the global namespace with arbitrary names, I think a somewhat cleaner implementation is to allow the user to specify the name from the command line or config. Compared to the alternatives, this still allows for the stop functionality to be called from a command line invocation, while polluting with a user-chosen name.
Checklist
npm run lint
) without any errors or warnings (every line errors "Expected linebreaks to be 'LF' but found 'CRLF'" which I guess is because I am on windows? No other errors)Description
In my use case (and Issue #32) I don't know exactly how long the capture should be before hand. This PR allows page to use
window.stopCapture()
to control when capture ends.