-
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
Stop capture #56
Stop capture #56
Conversation
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still thinking about what I'd prefer the name to be instead of window.stopCapture()
, but here are the other changes I have in mind. I'll do another review when I decide on a different name.
This may be a better way to handle - #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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of using the set name stopCapture
, I think it's cleaner to allow the user to specify the name of the stop function via config.stopFunctionName
from node or --stop-function-name
from the command line.
The command line and node API sections of README.md
need this addition, as does cli.js
, though I can make these changes.
Let me know what you think.
* Stop capture (#56) * adds a `config.stopFunctionName` and `--stop-function-name` which allows the user to specify a function that can be called to stop capture * updated cli.js and README.md for stopFunctionName Co-authored-by: RhinoW <[email protected]> Co-authored-by: user <[email protected]>
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.