|
|
|
@ -138,15 +138,15 @@ class Driver {
|
|
|
|
|
})
|
|
|
|
|
.then(() => {
|
|
|
|
|
const links = Array.prototype.reduce.call(
|
|
|
|
|
browser.document.getElementsByTagName('a'),
|
|
|
|
|
(acc, link) => {
|
|
|
|
|
if (link.protocol.match(/https?:/) || link.hostname === this.origPageUrl.hostname || extensions.test(link.pathname)) {
|
|
|
|
|
browser.document.getElementsByTagName('a'), (results, link) => {
|
|
|
|
|
if ( link.protocol.match(/https?:/) || link.hostname === this.origPageUrl.hostname || extensions.test(link.pathname) ) {
|
|
|
|
|
link.hash = '';
|
|
|
|
|
acc.push(url.parse(link.href));
|
|
|
|
|
|
|
|
|
|
results.push(url.parse(link.href));
|
|
|
|
|
}
|
|
|
|
|
return acc;
|
|
|
|
|
},
|
|
|
|
|
[]
|
|
|
|
|
|
|
|
|
|
return results;
|
|
|
|
|
}, []
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
return resolve(links);
|
|
|
|
|