Skip to content

Instantly share code, notes, and snippets.

@c80609a
Last active May 19, 2017 08:57
Show Gist options
  • Save c80609a/3877afe7dc5c4672b90c6cba02f0958f to your computer and use it in GitHub Desktop.
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
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);
@c80609a
Copy link
Author

c80609a commented May 19, 2017

Use "JavaScript tricks" Google Chrome extension to inject this js to page:
https://chrome.google.com/webstore/detail/jscript-tricks/odialddippdmebbfbflcneemfdglimod

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment