diff options
| author | Jez Ng | 2012-01-19 01:27:57 +0800 |
|---|---|---|
| committer | Jez Ng | 2012-01-26 02:48:00 -0500 |
| commit | 40963e7b35490de8a8629355a5b26b1e00cd4260 (patch) | |
| tree | 30e3776ee5fe658b44fe189c255e2160f0e2a1ff /vimiumFrontend.js | |
| parent | d2bb6e36eb1402ce33231e7eff2684708a858ac7 (diff) | |
| download | vimium-40963e7b35490de8a8629355a5b26b1e00cd4260.tar.bz2 | |
When activating links, click instead of setting window.location.
This allows us to activate Ajax links properly.
Diffstat (limited to 'vimiumFrontend.js')
| -rw-r--r-- | vimiumFrontend.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/vimiumFrontend.js b/vimiumFrontend.js index 3521dca5..ea2c33d5 100644 --- a/vimiumFrontend.js +++ b/vimiumFrontend.js @@ -843,7 +843,11 @@ function findAndFollowLink(linkStrings) { if (hasResults) { var link = getLinkFromSelection(); if (link) { - window.location = link.href; + domUtils.simulateClick(link); + // blur the element just in case it already has focus. then when we re-focus it, the browser will + // scroll such that it is visible. + link.blur(); + link.focus(); return true; } } @@ -857,7 +861,9 @@ function findAndFollowRel(value) { var elements = document.getElementsByTagName(relTags[i]); for (j = 0; j < elements.length; j++) { if (elements[j].hasAttribute('rel') && elements[j].rel == value) { - window.location = elements[j].href; + domUtils.simulateClick(elements[j]); + link.blur(); + link.focus(); return true; } } |
