From 69f575c83f4a15bf1489f1529c96ed1f1cd36648 Mon Sep 17 00:00:00 2001 From: avasilkov Date: Sat, 2 Jun 2018 07:00:52 +0300 Subject: [PATCH] npm driver fix url filter in recursive mode. allow only urls from the same host (#2317) --- src/drivers/npm/driver.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/drivers/npm/driver.js b/src/drivers/npm/driver.js index 75d12a8bc..9e8f13dce 100644 --- a/src/drivers/npm/driver.js +++ b/src/drivers/npm/driver.js @@ -146,7 +146,7 @@ class Driver { .then(() => { const links = Array.prototype.reduce.call( browser.document.getElementsByTagName('a'), (results, link) => { - if ( link.protocol.match(/https?:/) || link.hostname === this.origPageUrl.hostname || extensions.test(link.pathname) ) { + if ( link.protocol.match(/https?:/) && link.hostname === this.origPageUrl.hostname && extensions.test(link.pathname) ) { link.hash = ''; results.push(url.parse(link.href));