From 95ee40fa8cdca9cff0aba033a4352fc0621a9583 Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Mon, 5 Mar 2018 19:06:55 +0100 Subject: Add generic click behavior script Configureable. Clicks elements matching one (or more) CSS selectors once or multiple times. Currently supported: Facebook, Twitter, Disqus (embedded iframe) --- crocoite/behavior.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'crocoite/behavior.py') diff --git a/crocoite/behavior.py b/crocoite/behavior.py index e4ec93b..26841aa 100644 --- a/crocoite/behavior.py +++ b/crocoite/behavior.py @@ -222,17 +222,18 @@ class Screenshot (Behavior): 'X-Chrome-Viewport': viewport}) writer.write_record (record) -### Site-specific scripts ### +class Click (JsOnload): + """ Generic link clicking """ + + name = 'click' + scriptPath = 'click.js' -class Twitter (HostnameFilter, JsOnload): - name = 'twitter' - scriptPath = 'per-site/twitter.js' - hostname = ['com', 'twitter'] +### Site-specific scripts ### # available behavior scripts. Order matters, move those modifying the page # towards the end of available -generic = [Scroll, EmulateScreenMetrics] -perSite = [Twitter] +generic = [Scroll, EmulateScreenMetrics, Click] +perSite = [] available = generic + perSite + [Screenshot, DomSnapshot] availableNames = set (map (lambda x: x.name, available)) -- cgit v1.2.3