From 070bf5b2196955e6447869c23147422b4c64ffd6 Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Sat, 24 Nov 2018 12:57:03 +0100 Subject: behavior: Fix scrolling - Introduce stop() method callable from Python. Looks like the old method (global variable) was not working (any more?). This is much better anyway. - Restore state of scrolled elements (not window). Fixes weird screenshots of twitter.com. --- crocoite/controller.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crocoite/controller.py') diff --git a/crocoite/controller.py b/crocoite/controller.py index dd47776..4d95b09 100644 --- a/crocoite/controller.py +++ b/crocoite/controller.py @@ -167,10 +167,10 @@ class SinglePageController: enabledBehavior = list (filter (lambda x: self.url in x, map (lambda x: x (l, logger), self.behavior))) + await l.start () for b in enabledBehavior: async for item in b.onload (): self.processItem (item) - await l.start () # wait until the browser has a) been idle for at least # settings.idleTimeout or b) settings.timeout is exceeded @@ -197,11 +197,11 @@ class SinglePageController: idleTimeout = self.settings.idleTimeout else: idleTimeout = None - await l.tab.Page.stopLoading () for b in enabledBehavior: async for item in b.onstop (): self.processItem (item) + await l.tab.Page.stopLoading () await asyncio.sleep (1) -- cgit v1.2.3