🏠 Home 

Mangaelo declutter and shortcuts

Removes shit from mangaelo


Install this script?
  1. // ==UserScript==
  2. // @name Mangaelo declutter and shortcuts
  3. // @namespace https://github.com/Bobocato/Userscripts
  4. // @version 1.0
  5. // @description Removes shit from mangaelo
  6. // @author Bobocato
  7. // @match https://manganelo.com/chapter/*
  8. // @grant none
  9. // ==/UserScript==
  10. var autoload = true;
  11. (function() {
  12. 'use strict';
  13. //Remove Header and footer stuff
  14. //Header
  15. document.getElementsByClassName("logo_chapter")[0].remove();
  16. document.getElementsByClassName("breadcrumb")[0].remove();
  17. document.getElementsByClassName("option_wrap")[0].remove();
  18. document.getElementsByClassName("info-top-chapter")[0].remove();
  19. //Footer
  20. document.getElementsByClassName("breadcrumb")[0].remove();
  21. document.getElementsByTagName("footer")[0].remove();
  22. document.getElementsByClassName("comments")[0].remove();
  23. let as = document.getElementsByTagName("A")
  24. for(let i = 0; i < as.length; i++){
  25. if(as[i].href == "https://manganelo.com/home"){
  26. as[i].remove();
  27. i = 500;
  28. }
  29. }
  30. if(autoload){
  31. var timer = null;
  32. window.addEventListener("scroll", function(event) {
  33. var e = document.documentElement;
  34. if (e.scrollHeight - e.scrollTop === e.clientHeight)
  35. {
  36. console.log("Bomb has been planted");
  37. timer = setTimeout(nextChapter, 1500);
  38. } else {
  39. if (timer != null){
  40. console.log("Bomb has been defused");
  41. clearTimeout(timer);
  42. timer = null;
  43. }
  44. }
  45. });
  46. }
  47. document.addEventListener("keydown", keyDownTextField, false);
  48. function keyDownTextField(e) {
  49. var search = document.getElementsByClassName("searchinput")[0];
  50. if (document.activeElement !== search) {
  51. switch (e.which) {
  52. case 37: // "Arrow Left"
  53. document.getElementsByClassName("next")[0].click();
  54. break;
  55. case 39: // "Arrow Right"
  56. nextChapter();
  57. break
  58. default:
  59. return; // exit this handler for other keys
  60. }
  61. e.preventDefault(); // prevent the default action
  62. } else if (e.which == 32) {
  63. search.value += " ";
  64. e.preventDefault();
  65. }
  66. return;
  67. }
  68. function nextChapter(){
  69. document.getElementsByClassName("back")[0].click();
  70. }
  71. function getDocHeight() {
  72. var D = document;
  73. return Math.max(
  74. D.body.scrollHeight, D.documentElement.scrollHeight,
  75. D.body.offsetHeight, D.documentElement.offsetHeight,
  76. D.body.clientHeight, D.documentElement.clientHeight
  77. );
  78. }
  79. })();