Last active
July 2, 2018 08:09
-
-
Save dm00z/dadf71588d8263086da9f67786689c87 to your computer and use it in GitHub Desktop.
Simple MangaDex scroller by pressing up and down
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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