Skip to content

Instantly share code, notes, and snippets.

@dm00z
Last active July 2, 2018 08:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dm00z/dadf71588d8263086da9f67786689c87 to your computer and use it in GitHub Desktop.
Save dm00z/dadf71588d8263086da9f67786689c87 to your computer and use it in GitHub Desktop.
Simple MangaDex scroller by pressing up and down
// ==UserScript==
// @name MangaDex Scroller
// @namespace https://gist.github.com/dm00z/dadf71588d8263086da9f67786689c87
// @version 0.3
// @description Simple MangaDex scroller by pressing up and down
// @author dm00z
// @match https://mangadex.org/chapter/*
// @grant none
// @downloadURL https://gist.github.com/dm00z/dadf71588d8263086da9f67786689c87/raw/2d3ef0c07a6f1f3b0ad787e534e964ba2cea21c8/mangadex_scroller.user.js
// ==/UserScript==
document.onkeydown = checkKey;
var scrollBy = 300;
function checkKey(e) {
e = e || window.event;
if (e.keyCode == '38') {
// up arrow
e.stopPropagation();
window.scrollBy(0, -scrollBy);
}
else if (e.keyCode == '40') {
// down arrow
e.stopPropagation();
window.scrollBy(0, scrollBy);
}
else if (e.keyCode == '37') {
// left arrow
}
else if (e.keyCode == '39') {
// right arrow
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment