diff options
| author | Jez Ng | 2012-02-29 17:57:45 -0500 | 
|---|---|---|
| committer | Jez Ng | 2012-02-29 22:11:37 -0500 | 
| commit | cca64166440d0aed4c52a55e0e959d6f9afcc370 (patch) | |
| tree | 98d3f017b873adaaec6d23884f9f1c30b65f99f3 /vimiumFrontend.js | |
| parent | e8036f4a38d79e7c1ecda93e7e8ca33d9ea669cd (diff) | |
| download | vimium-cca64166440d0aed4c52a55e0e959d6f9afcc370.tar.bz2 | |
Activate <link> elements by setting window.location.
Diffstat (limited to 'vimiumFrontend.js')
| -rw-r--r-- | vimiumFrontend.js | 14 | 
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); +  }  }  /** | 
