Shortcut for /review

Adds a keyboard shortcut [R] for /review

  1. // ==UserScript==
  2. // @name Shortcut for /review
  3. // @version 1.0
  4. // @description Adds a keyboard shortcut [R] for /review
  5. // @author nicael
  6. // @include *://*.stackexchange.com/*
  7. // @include *://*stackoverflow.com/*
  8. // @include *://*serverfault.com/*
  9. // @include *://*superuser.com/*
  10. // @include *://*askubuntu.com/*
  11. // @include *://*stackapps.com/*
  12. // @grant none
  13. // @namespace https://greasyfork.org/users/9713
  14. // ==/UserScript==
  15.  
  16. $(document).keypress(function (event) {
  17. if (event.charCode == 114&&$(".keyboard-console > pre:contains('go to')").css("display")=="block") {
  18. location.href="/review";
  19. }
  20. });
  21. $(document).keypress(function (event) {
  22. if (event.which == 103) {
  23. setTimeout(function () {
  24. console.log($(".keyboard-console").css("display"));
  25. $(".keyboard-console > pre:contains('go to')").append("<b><kbd>R</kbd> review</b><rv></rv>");
  26. }, 10);
  27.  
  28. }
  29. });