summaryrefslogtreecommitdiff
path: root/crocoite/behavior.py
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2018-06-03 15:20:38 +0200
committerLars-Dominik Braun <lars@6xq.net>2018-06-03 15:20:38 +0200
commitd1e18aa4d975060283a29bcc74182d82f23201fa (patch)
treefe7b9bdbd21d3bcd87b0af3f36fd376c4f0ec80b /crocoite/behavior.py
parent3eb97707ea7a008a2665001ad9847e6ffcdb94b5 (diff)
downloadcrocoite-d1e18aa4d975060283a29bcc74182d82f23201fa.tar.gz
crocoite-d1e18aa4d975060283a29bcc74182d82f23201fa.tar.bz2
crocoite-d1e18aa4d975060283a29bcc74182d82f23201fa.zip
behavior: Wrap extract links script in anonymous namespace
Otherwise it may clash with symbols defined by the page.
Diffstat (limited to 'crocoite/behavior.py')
-rw-r--r--crocoite/behavior.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/crocoite/behavior.py b/crocoite/behavior.py
index c658699..95e8160 100644
--- a/crocoite/behavior.py
+++ b/crocoite/behavior.py
@@ -256,7 +256,8 @@ class ExtractLinks (Behavior):
def onfinish (self):
tab = self.loader.tab
self.useScript (self.script)
- self.links = list (set (tab.Runtime.evaluate (expression=self.script, returnByValue=True)['result']['value']))
+ result = tab.Runtime.evaluate (expression=self.script, returnByValue=True)
+ self.links = list (set (result['result']['value']))
# available behavior scripts. Order matters, move those modifying the page
# towards the end of available