User:Elominius/diff arrow keys.js

// diff arrow keys: navigate revisions conveniently with Ctrl+← and Ctrl+→.

var prev_diff_link=document.getElementById("differences-prevlink"); var next_diff_link=document.getElementById("differences-nextlink");

window.addEventListener("keydown", function(key_bind) { key_bind = key_bind || window.event;  if (key_bind.ctrlKey && key_bind.type=="keydown" && key_bind.which == 37 ) { if (prev_diff_link) { document.location.href=prev_diff_link.href; return false; } }  if (key_bind.ctrlKey && key_bind.type=="keydown" && key_bind.which == 39 ) { if (next_diff_link) { document.location.href=next_diff_link.href; return false; } }  return true;	} );