Last active
May 19, 2017 08:57
-
-
Save c80609a/3877afe7dc5c4672b90c6cba02f0958f to your computer and use it in GitHub Desktop.
Tab moves focus to the next search result. #google #chrome #google_search_page #without_mouse #only_keyboard #tab #serp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var f_ready = function() { | |
var $aa = $('h3.r > a'); | |
//console.log($aa); | |
var ptr = 0; | |
$(document).keydown(function(e) { | |
//console.log(e.keyCode); // tab keyCode = 9 | |
if (e.keyCode == 9) { | |
e.preventDefault(); | |
//console.log('+'); | |
$aa[ptr].focus(); | |
ptr++; | |
if (ptr >= $aa.length) { | |
ptr = 0; | |
} | |
} | |
}); | |
} | |
$(document).ready(f_ready); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use "JavaScript tricks" Google Chrome extension to inject this js to page:
https://chrome.google.com/webstore/detail/jscript-tricks/odialddippdmebbfbflcneemfdglimod