RARBG Pagination Arrows

Allows the usage of ← and → arrow keys to navigate between pages.

  1. // ==UserScript==
  2. // @name RARBG Pagination Arrows
  3. // @namespace DaBaldEagul
  4. // @description Allows the usage of ← and → arrow keys to navigate between pages.
  5. // @grant none
  6. // @license MIT
  7. // @match *://rarbg.to/torrents.php*
  8. // @match *://rarbg2018.org/torrents.php*
  9. // @match *://rarbg2019.org/torrents.php*
  10. // @match *://rarbg2020.org/torrents.php*
  11. // @match *://rarbg2021.org/torrents.php*
  12. // @match *://rarbgaccess.org/torrents.php*
  13. // @match *://rarbgaccessed.org/torrents.php*
  14. // @match *://rarbgcdn.org/torrents.php*
  15. // @match *://rarbgcore.org/torrents.php*
  16. // @match *://rarbgdata.org/torrents.php*
  17. // @match *://rarbgenter.org/torrents.php*
  18. // @match *://rarbgget.org/torrents.php*
  19. // @match *://rarbggo.org/torrents.php*
  20. // @match *://rarbgindex.org/torrents.php*
  21. // @match *://rarbgmirror.org/torrents.php*
  22. // @match *://rarbgmirrored.org/torrents.php*
  23. // @match *://rarbgp2p.org/torrents.php*
  24. // @match *://rarbgproxied.org/torrents.php*
  25. // @match *://rarbgproxies.org/torrents.php*
  26. // @match *://rarbgproxy.org/torrents.php*
  27. // @match *://rarbgprx.org/torrents.php*
  28. // @match *://rarbgto.org/torrents.php*
  29. // @match *://rarbgtor.org/torrents.php*
  30. // @match *://rarbgtorrents.org/torrents.php*
  31. // @match *://rarbgunblock.org/torrents.php*
  32. // @match *://rarbgunblocked.org/torrents.php*
  33. // @match *://rarbgway.org/torrents.php*
  34. // @match *://rarbgweb.org/torrents.php*
  35. // @match *://proxyrarbg.org/torrents.php*
  36. // @match *://unblockedrarbg.org/torrents.php*
  37. // @match *://rarbg.com/torrents.php*
  38. // @match *://rarbgmirror.com/torrents.php*
  39. // @match *://rarbgproxy.com/torrents.php*
  40. // @match *://rarbgunblock.com/torrents.php*
  41. // @version 0.0.1.20220123201843
  42. // ==/UserScript==
  43.  
  44. function getPreviousLink() {
  45. for(i=0;i<document.links.length;i++){
  46. if(document.links[i].title == 'previous page') {
  47. return document.links[i]
  48. }
  49. }
  50. }
  51. function getNextLink() {
  52. for(i=0;i<document.links.length;i++){
  53. if(document.links[i].title == 'next page') {
  54. return document.links[i]
  55. }
  56. }
  57. }
  58.  
  59. document.onkeydown = checkKey;
  60.  
  61. var prevlink = false;
  62. var nextlink = false;
  63.  
  64. if(getPreviousLink()) {
  65. prevlink = getPreviousLink().href;
  66. }
  67. if(getNextLink()) {
  68. nextlink = getNextLink().href;
  69. }
  70.  
  71. function checkKey(e) {
  72. e = e || window.event;
  73.  
  74. if (document.activeElement.toString().search(/(Input|TextArea)/) < 0) {
  75. if (e.keyCode == '37') {
  76. if (prevlink)
  77. location.href = prevlink;
  78. }
  79. else if (e.keyCode == '39') {
  80. if (nextlink)
  81. location.href = nextlink;
  82. }
  83. }
  84. }