summaryrefslogtreecommitdiff
path: root/crocoite/data
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/data
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/data')
-rw-r--r--crocoite/data/extract-links.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/crocoite/data/extract-links.js b/crocoite/data/extract-links.js
index 5199a63..4d1a3d0 100644
--- a/crocoite/data/extract-links.js
+++ b/crocoite/data/extract-links.js
@@ -1,6 +1,7 @@
/* Extract links from a page
*/
+(function () {
/* --- copy&paste from click.js --- */
/* Element is visible if itself and all of its parents are
*/
@@ -31,4 +32,5 @@ for (let i=0; i < x.length; i++) {
ret.push (x[i].href);
}
}
-ret; /* immediately return results, for use with Runtime.evaluate() */
+return ret; /* immediately return results, for use with Runtime.evaluate() */
+})();