summaryrefslogtreecommitdiff
path: root/crocoite/controller.py
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2018-11-24 12:57:03 +0100
committerLars-Dominik Braun <lars@6xq.net>2018-11-24 13:03:29 +0100
commit070bf5b2196955e6447869c23147422b4c64ffd6 (patch)
tree2c60c28c7f29dee203ca1ffbd8e200d49a83a58c /crocoite/controller.py
parent38441dafb7f5dd6e558db0b4dbc1a4f1a90df162 (diff)
downloadcrocoite-070bf5b2196955e6447869c23147422b4c64ffd6.tar.gz
crocoite-070bf5b2196955e6447869c23147422b4c64ffd6.tar.bz2
crocoite-070bf5b2196955e6447869c23147422b4c64ffd6.zip
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.
Diffstat (limited to 'crocoite/controller.py')
-rw-r--r--crocoite/controller.py4
1 files changed, 2 insertions, 2 deletions
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)