mirror of
https://github.com/internetarchive/brozzler.git
synced 2025-12-16 09:03:55 -05:00
Skip loading behavior when behavior_timeout=0
The user may set `behavior_timeout=0`. This means that they don't want to run the behavior. As it is now, Brozzler will invoke `brozzler.behavior_script` to load the script and `self.run_behavior` to execute it. We will run the behavior using `Runtime.evaluate` but then it will be terminated immediately because of timeout=0. It is better to skip behavior loading and running when `behavior_timeout=0`.
This commit is contained in:
parent
dc0d99470a
commit
8b10587031
1 changed files with 1 additions and 1 deletions
|
|
@ -509,7 +509,7 @@ class Browser:
|
||||||
self.websock_thread.page_status >= 400):
|
self.websock_thread.page_status >= 400):
|
||||||
run_behaviors = False
|
run_behaviors = False
|
||||||
|
|
||||||
if run_behaviors:
|
if run_behaviors and behavior_timeout > 0:
|
||||||
behavior_script = brozzler.behavior_script(
|
behavior_script = brozzler.behavior_script(
|
||||||
page_url, behavior_parameters,
|
page_url, behavior_parameters,
|
||||||
behaviors_dir=behaviors_dir)
|
behaviors_dir=behaviors_dir)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue