diff options
-rw-r--r-- | crocoite/controller.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crocoite/controller.py b/crocoite/controller.py index 8b25d1f..22e7e28 100644 --- a/crocoite/controller.py +++ b/crocoite/controller.py @@ -137,6 +137,10 @@ class SinglePageController: start = time.time () + # not all behavior scripts are allowed for every URL, filter them + enabledBehavior = list (filter (lambda x: self.url in x, + map (lambda x: x (l, logger), self.behavior))) + version = await l.tab.Browser.getVersion () payload = { 'software': { @@ -157,15 +161,11 @@ class SinglePageController: 'url': self.url, 'idleTimeout': self.settings.idleTimeout, 'timeout': self.settings.timeout, - 'behavior': list (map (attrgetter('name'), self.behavior)), + 'behavior': list (map (attrgetter('name'), enabledBehavior)), }, } self.processItem (ControllerStart (payload)) - # not all behavior scripts are allowed for every URL, filter them - 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 (): |