ulixee / secret-agent

The web scraper that's nearly impossible to block - now called @ulixee/hero
https://secretagent.dev
MIT License
670 stars 44 forks source link

Shutting down example scripts #41

Closed blakebyrnes closed 4 years ago

blakebyrnes commented 4 years ago

Should we add SecretAgent.shutdown to website examples? Or should we try to detect if we're the only thing sitting in the event loop and shutdown?

blakebyrnes commented 4 years ago

From @calebjclark

@blakebyrnes I wonder if we should have browser.close() trigger a full SecretAgent.shutdown() unless:

A) another browser window is still open, or
B) SecretAgent.start() had been used.

Otherwise, it's going to hang without calling SecretAgent.shutdown(), but that seems overkill in the majority of use-cases.

_Originally posted by @calebjclark in https://github.com/ulixee/secret-agent/issues/35#issuecomment-662710202_