Merge pull request #2727 from kyletaylored/feature/2694-cannot-read-prop-match

Check for HTMLAnchorElement properties on links
main
Elbert Alias 6 years ago committed by GitHub
commit 1b9318d3df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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