Dont follow rel="nofollow" links in NPM driver

main
Elbert Alias 6 years ago
parent 8e193e89fc
commit a659eaee4f

@ -242,16 +242,15 @@ class Driver {
const reducedLinks = Array.prototype.reduce.call( const reducedLinks = Array.prototype.reduce.call(
browser.links, (results, link) => { browser.links, (results, link) => {
// Catch broken links. if (
if (!link.protocol) { results
this.wappalyzer.log("Element is not a valid link interface.", "driver", "error"); && Object.prototype.hasOwnProperty.call(results, 'push')
return; && link.protocol
} && link.protocol.match(/https?:/)
if (results == null || !results.hasOwnProperty("push")) { && link.rel !== 'nofollow'
this.wappalyzer.log("Result object is not an array.", "driver", "error"); && link.hostname === this.origPageUrl.hostname
return; && extensions.test(link.pathname)
} ) {
if (link.protocol.match(/https?:/) && link.hostname === this.origPageUrl.hostname && extensions.test(link.pathname)) {
link.hash = ''; link.hash = '';
results.push(url.parse(link.href)); results.push(url.parse(link.href));