ehentai flipping shortcut

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

Ekde 2024/12/18. Vidu La ĝisdata versio.

  1. // ==UserScript==
  2. // @name ehentai flipping shortcut
  3. // @namespace none
  4. // @version 0.1.1
  5. // @description use 'A','D','←','→' to flip page in e-hentai/exhentai, also works in gallery view
  6. // @author creonly
  7. // @match https://exhentai.org/*
  8. // @match http://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. var uprev = document.getElementById("uprev");
  22. var unext = document.getElementById("unext");
  23. if(b.keyCode=="37"|b.keyCode=="65"){
  24. if(ptt){
  25. window.location.href=ptt.getElementsByTagName("a")[1].href;
  26. }
  27. if(uprev){
  28. window.location.href=uprev.href;
  29. }
  30. }else if(b.keyCode=="39"|b.keyCode=="68"){
  31. if(ptt){
  32. window.location.href=ptt.getElementsByTagName("a")[2].href;
  33. }
  34. if(unext){
  35. window.location.href=unext.href;
  36. }
  37. }
  38. };