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