aboutsummaryrefslogtreecommitdiffstats
path: root/vimiumFrontend.js
diff options
context:
space:
mode:
authorJez Ng2012-02-29 17:57:45 -0500
committerJez Ng2012-02-29 22:11:37 -0500
commitcca64166440d0aed4c52a55e0e959d6f9afcc370 (patch)
tree98d3f017b873adaaec6d23884f9f1c30b65f99f3 /vimiumFrontend.js
parente8036f4a38d79e7c1ecda93e7e8ca33d9ea669cd (diff)
downloadvimium-cca64166440d0aed4c52a55e0e959d6f9afcc370.tar.bz2
Activate <link> elements by setting window.location.
Diffstat (limited to 'vimiumFrontend.js')
-rw-r--r--vimiumFrontend.js14
1 files changed, 10 insertions, 4 deletions
diff --git a/vimiumFrontend.js b/vimiumFrontend.js
index d65a5a23..357d444e 100644
--- a/vimiumFrontend.js
+++ b/vimiumFrontend.js
@@ -853,10 +853,16 @@ function getLinkFromSelection() {
}
// used by the findAndFollow* functions.
-function followLink(link) {
- link.scrollIntoView();
- link.focus();
- domUtils.simulateClick(link);
+function followLink(linkElement) {
+ if (linkElement.nodeName.toLowerCase() === 'link')
+ window.location.href = linkElement.href;
+ else {
+ // if we can click on it, don't simply set location.href: some pages listen for click events to fire off
+ // AJAX calls.
+ linkElement.scrollIntoView();
+ linkElement.focus();
+ domUtils.simulateClick(linkElement);
+ }
}
/**