From ee8c235aeaf52d2bc867a00c37731690e337c7ff Mon Sep 17 00:00:00 2001 From: Scott Pinkelman Date: Tue, 26 Apr 2016 15:01:49 -0400 Subject: Improves next/previous links by targetting button elements and adding single left/right angle quotation marks --- CREDITS | 1 + content_scripts/vimium_frontend.coffee | 2 +- lib/settings.coffee | 8 ++++---- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CREDITS b/CREDITS index b11497ca..62e79698 100644 --- a/CREDITS +++ b/CREDITS @@ -45,5 +45,6 @@ Contributors: Utkarsh Upadhyay (github: PrestanceDesign) Dahan Gong (github: gdh1995) + Scott Pinkelman (github: sco-tt) Feel free to add real names in addition to GitHub usernames. diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee index d316da4c..4d081e90 100644 --- a/content_scripts/vimium_frontend.coffee +++ b/content_scripts/vimium_frontend.coffee @@ -543,7 +543,7 @@ followLink = (linkElement) -> # next big thing', and 'more' over 'nextcompany', even if 'next' occurs before 'more' in :linkStrings. # findAndFollowLink = (linkStrings) -> - linksXPath = DomUtils.makeXPath(["a", "*[@onclick or @role='link' or contains(@class, 'button')]"]) + linksXPath = DomUtils.makeXPath(["a", "button", "*[@onclick or @role='link' or contains(@class, 'button')]"]) links = DomUtils.evaluateXPath(linksXPath, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE) candidateLinks = [] diff --git a/lib/settings.coffee b/lib/settings.coffee index 70dc1147..92871ee2 100644 --- a/lib/settings.coffee +++ b/lib/settings.coffee @@ -144,10 +144,10 @@ Settings = # "first/last page", so we put the single bracket first in the pattern string so that it gets searched # for first. - # "\bprev\b,\bprevious\b,\bback\b,<,←,«,≪,<<" - previousPatterns: "prev,previous,back,older,<,\u2190,\xab,\u226a,<<" - # "\bnext\b,\bmore\b,>,→,»,≫,>>" - nextPatterns: "next,more,newer,>,\u2192,\xbb,\u226b,>>" + # "\bprev\b,\bprevious\b,\bback\b,<,‹,←,«,≪,<<" + previousPatterns: "prev,previous,back,older,<,\u2039,\u2190,\xab,\u226a,<<" + # "\bnext\b,\bmore\b,>,›,→,»,≫,>>" + nextPatterns: "next,more,newer,>,\u203a,\u2192,\xbb,\u226b,>>" # default/fall back search engine searchUrl: "https://www.google.com/search?q=" # put in an example search engine -- cgit v1.2.3