diff --git a/browser-extension/common.js b/browser-extension/common.js index 0cf9ca6..fe72641 100644 --- a/browser-extension/common.js +++ b/browser-extension/common.js @@ -17,7 +17,13 @@ function redirect(searchQuery) { var wikiUrlRow = infoboxRows.filter(x => x.innerText.match(/(?:URL)|(?:Website)/)); if (wikiUrlRow[0]) { - return wikiUrlRow[0].querySelector('a').href; + for (let i in wikiUrlRow) { + let a = wikiUrlRow[i].querySelector('a'); + if (a) { + return a.href; + } + } + return wikiUrl; } else { return wikiUrl; } diff --git a/browser-extension/testcases.txt b/browser-extension/testcases.txt new file mode 100644 index 0000000..8583d8d --- /dev/null +++ b/browser-extension/testcases.txt @@ -0,0 +1 @@ +virustotal.idk \ No newline at end of file