summaryrefslogtreecommitdiff
path: root/crocoite/data
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2019-01-04 12:29:13 +0100
committerLars-Dominik Braun <lars@6xq.net>2019-01-04 12:29:13 +0100
commit9bfb369f0bf05d8f104e39b6c93d95af37fd7739 (patch)
tree8e43a456964b495df0905f02cd0007602d8d744e /crocoite/data
parent9d7974e3e7e8a4575ea61cb33a30fa291d12ae38 (diff)
downloadcrocoite-9bfb369f0bf05d8f104e39b6c93d95af37fd7739.tar.gz
crocoite-9bfb369f0bf05d8f104e39b6c93d95af37fd7739.tar.bz2
crocoite-9bfb369f0bf05d8f104e39b6c93d95af37fd7739.zip
behavior: Support clicking area and add testcase
Diffstat (limited to 'crocoite/data')
-rw-r--r--crocoite/data/extract-links.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/crocoite/data/extract-links.js b/crocoite/data/extract-links.js
index 4d1a3d0..483a35f 100644
--- a/crocoite/data/extract-links.js
+++ b/crocoite/data/extract-links.js
@@ -25,12 +25,14 @@ function isClickable (o) {
}
/* --- end copy&paste */
-let x = document.body.querySelectorAll('a[href]');
let ret = [];
-for (let i=0; i < x.length; i++) {
- if (isClickable (x[i])) {
- ret.push (x[i].href);
+['a[href]', 'area[href]'].forEach (function (s) {
+ let x = document.body.querySelectorAll(s);
+ for (let i=0; i < x.length; i++) {
+ if (isClickable (x[i])) {
+ ret.push (x[i].href);
+ }
}
-}
+});
return ret; /* immediately return results, for use with Runtime.evaluate() */
})();