From d1e18aa4d975060283a29bcc74182d82f23201fa Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Sun, 3 Jun 2018 15:20:38 +0200 Subject: behavior: Wrap extract links script in anonymous namespace Otherwise it may clash with symbols defined by the page. --- crocoite/data/extract-links.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'crocoite/data') 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() */ +})(); -- cgit v1.2.3