summaryrefslogtreecommitdiff
path: root/crocoite/behavior.py
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2018-12-02 17:26:44 +0100
committerLars-Dominik Braun <lars@6xq.net>2018-12-02 17:26:44 +0100
commit1e617fe1d831fbada8794b3986512b4924bdd1d7 (patch)
tree8b8ca419f434fcc3c933a668b03fc6eea25d84c0 /crocoite/behavior.py
parent1abc9f4644249436d4439b9033544a0309db5289 (diff)
downloadcrocoite-1e617fe1d831fbada8794b3986512b4924bdd1d7.tar.gz
crocoite-1e617fe1d831fbada8794b3986512b4924bdd1d7.tar.bz2
crocoite-1e617fe1d831fbada8794b3986512b4924bdd1d7.zip
behavior: Add more documentation
Diffstat (limited to 'crocoite/behavior.py')
-rw-r--r--crocoite/behavior.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/crocoite/behavior.py b/crocoite/behavior.py
index 38bafd8..e731bcd 100644
--- a/crocoite/behavior.py
+++ b/crocoite/behavior.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2017 crocoite contributors
+# Copyright (c) 2017–2018 crocoite contributors
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -19,7 +19,19 @@
# THE SOFTWARE.
"""
-Generic and per-site behavior scripts
+Behavior scripts (i.e. subclasses of Behavior) are a powerful method to
+manipulate websites loaded into Chrome. They are executed by the controller
+after the page started loading (onload), after it has been idle for a while
+(onstop) and after loading was stopped (onfinish).
+
+The script’s excercise their power either through DevTools API calls or by
+injecting JavaScript into the page context. Thus they can manipulate both, the
+browser itself (DevTools; modify resolution, get DOM snapshot) as well as the
+page (JavaScript; trigger JavaScript events, call web API’s).
+
+They also emit (yield) data processable by any consumer registered to the
+controller. This allows storing captured screenshots inside WARC files, for
+instance.
"""
import asyncio