From: Daniel Carl Date: Thu, 31 Oct 2013 19:44:45 +0000 (+0100) Subject: Added //*[@href] to hinting xpath. X-Git-Url: https://git.owens.tech/assets/me.jpg/assets/me.jpg/git?a=commitdiff_plain;h=d9d9647ead5da10badd5f3c5c12daf6958b94094;p=vimb.git Added //*[@href] to hinting xpath. This allow to hint also links on pages that use own namespaces like http://5digits.org/help/pentadactyl/ where '//a' would not find any match. --- diff --git a/src/hints.js b/src/hints.js index d3de542..164703c 100644 --- a/src/hints.js +++ b/src/hints.js @@ -368,11 +368,11 @@ var VbHint = (function(){ switch (config.mode) { case "l": if (!s) { - return "//a[@href] | //*[@onclick or @tabindex or @class='lk' or @role='link' or @role='button'] | //input[not(@type='hidden' or @disabled or @readonly)] | //textarea[not(@disabled or @readonly)] | //button | //select"; + return "//*[@href] | //*[@onclick or @tabindex or @class='lk' or @role='link' or @role='button'] | //input[not(@type='hidden' or @disabled or @readonly)] | //textarea[not(@disabled or @readonly)] | //button | //select"; } return buildQuery( ["@value", ".", "@placeholder", "@title", "@alt"], - "//a[@href and ($. or child::img[$@title or $@alt])] | //*[(@onclick or @class='lk' or @role='link' or role='button') and $.] | //input[not(@type='hidden' or @disabled or @readonly) and ($@value or $@placeholder)] | //textarea[not(@disabled or @readonly) and $.] | //button[$.] | //select[$.]", + "//*[@href and ($. or child::img[$@title or $@alt])] | //*[(@onclick or @class='lk' or @role='link' or role='button') and $.] | //input[not(@type='hidden' or @disabled or @readonly) and ($@value or $@placeholder)] | //textarea[not(@disabled or @readonly) and $.] | //button[$.] | //select[$.]", s ); case "e":