aboutsummaryrefslogtreecommitdiffstats
path: root/linkHints.js
diff options
context:
space:
mode:
authorjez2011-05-14 19:58:30 -0400
committerjez2011-05-14 19:58:30 -0400
commit45f8103170855ba7748b73c656e42b523586a432 (patch)
tree6535313ec6f817cc737da4135f3cf001e217cba9 /linkHints.js
parent6534e0fc55d18fc9011576b4c63cfbd45ce18649 (diff)
downloadvimium-45f8103170855ba7748b73c656e42b523586a432.tar.bz2
Remove focus after clicking on links.
Deals with issue #193. Thanks to @blaix for the original fix in pull request 318.
Diffstat (limited to 'linkHints.js')
-rw-r--r--linkHints.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/linkHints.js b/linkHints.js
index f9a60857..0f65d892 100644
--- a/linkHints.js
+++ b/linkHints.js
@@ -280,6 +280,11 @@ var linkHints = {
// Debugging note: Firefox will not execute the link's default action if we dispatch this click event,
// but Webkit will. Dispatching a click on an input box does not seem to focus it; we do that separately
link.dispatchEvent(event);
+
+ // TODO(int3): do this for @role='link' and similar elements as well
+ var nodeName = link.nodeName.toLowerCase();
+ if (nodeName == 'a' || nodeName == 'button')
+ link.blur();
},
/*