summaryrefslogtreecommitdiff
path: root/crocoite
diff options
context:
space:
mode:
Diffstat (limited to 'crocoite')
-rw-r--r--crocoite/controller.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/crocoite/controller.py b/crocoite/controller.py
index d6f6d7a..e250cc5 100644
--- a/crocoite/controller.py
+++ b/crocoite/controller.py
@@ -161,7 +161,9 @@ class SinglePageController:
# wait until the browser has a) been idle for at least
# settings.idleTimeout or b) settings.timeout is exceeded
timeoutProc = asyncio.ensure_future (asyncio.sleep (self.settings.timeout))
- idleTimeout = None
+ # the browser might have changed to idle from .navigate until here
+ # due to awaits inbetween. Thus, idleProc may never be triggered.
+ idleTimeout = None if not l.idle.get() else self.settings.idleTimeout
while True:
idleProc = asyncio.ensure_future (l.idle.wait ())
try: