From 77e1f226003a696520b364650db20b308e4b71c0 Mon Sep 17 00:00:00 2001 From: Jez Ng Date: Tue, 21 Aug 2012 00:24:37 -0700 Subject: Don't follow prev/next links without an exact word match. Closes #617. --- content_scripts/vimium_frontend.coffee | 8 -------- 1 file changed, 8 deletions(-) diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee index 4de0a695..5b7a7402 100644 --- a/content_scripts/vimium_frontend.coffee +++ b/content_scripts/vimium_frontend.coffee @@ -788,20 +788,12 @@ findAndFollowLink = (linkStrings) -> ) .filter((a) -> wordCount(a) <= wordCount(candidateLinks[0]) + 1) - # try to get exact word matches first for linkString in linkStrings for candidateLink in candidateLinks exactWordRegex = new RegExp("\\b" + linkString + "\\b", "i") if (exactWordRegex.test(candidateLink.innerText)) followLink(candidateLink) return true - - for linkString in linkStrings - for candidateLink in candidateLinks - if (candidateLink.innerText.toLowerCase().indexOf(linkString) != -1) - followLink(candidateLink) - return true - false findAndFollowRel = (value) -> -- cgit v1.2.3