Skip to content

Commit

Permalink
checking iframes too.
Browse files Browse the repository at this point in the history
  • Loading branch information
maitegm authored and Alp Toker committed Jul 15, 2017
1 parent c73fc63 commit 18b605e
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions crawler.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,23 @@ class BlockCrawler extends EventEmitter {
var href = href.split('#')[0];
this.enqueue(href, res);
});
$('iframe').each((index, node) => {
var $node = $(node);
/* No rel attribute in iframe specs.
* var rel = $node.attr('rel') || '';
* rel = rel.split(/ +/);
* if (rel.indexOf('nofollow') !== -1)
* return;
*/
var src = $node.attr('src');
if(!src)
return;
var src = src.split('#')[0];
this.enqueue(src, res);

//TODO check srcdoc attribute

});
}

// Test and possible transform url object
Expand Down

0 comments on commit 18b605e

Please sign in to comment.