ehentai flipping shortcut

use 'A','D','←','→' to flip page in e-hentai/exhentai, also works in gallery view

Mint 2024.12.18.. Lásd a legutóbbi verzió

  1. // ==UserScript==
  2. // @name ehentai flipping shortcut
  3. // @namespace none
  4. // @version 0.1.3
  5. // @description use 'A','D','←','→' to flip page in e-hentai/exhentai, also works in gallery view
  6. // @author creonly
  7. // @match exhentai.org/*
  8. // @match e-hentai.org/*
  9. // @grant none
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. // Your code here...
  17. })();
  18. document.onkeydown=function(b){
  19. b=(b)?b:window.event;
  20. var ptt=document.getElementsByClassName("ptt")[0];
  21. if(ptt){
  22. ptt = ptt.getElementsByTagName("a")
  23. }
  24. var uprev = document.getElementById("uprev");
  25. var unext = document.getElementById("unext");
  26. if(b.keyCode=="37"|b.keyCode=="65"){
  27. if(ptt){
  28. window.location.href=ptt[0].href;
  29. }
  30. if(uprev){
  31. window.location.href=uprev.href;
  32. }
  33. }else if(b.keyCode=="39"|b.keyCode=="68"){
  34. if(ptt){
  35. window.location.href=ptt[ptt.length-1].href;
  36. }
  37. if(unext){
  38. window.location.href=unext.href;
  39. }
  40. }
  41. };