Skip to content

Instantly share code, notes, and snippets.

@saschanaz
Last active August 29, 2015 14:13
Show Gist options
  • Save saschanaz/f189521523c3064c79c1 to your computer and use it in GitHub Desktop.
Save saschanaz/f189521523c3064c79c1 to your computer and use it in GitHub Desktop.
Smartoon Descroller
// ==UserScript==
// @name Smarttoon Descroller
// @namespace sn-smartoon-descroller
// @include http://m.comic.naver.com/webtoon/detail.nhn?*
// @version 1.2.0
// @grant none
// ==/UserScript==
document.addEventListener("DOMContentLoaded", () => {
if (!window.SmarttoonViewer)
return;
document.body.style.overflow = "hidden";
window.addEventListener("keyup", (ev) => {
switch (ev.key) {
case "Left":
case "ArrowLeft":
SmarttoonViewer._aInstance[0]._movePreviousCut();
break;
case "Right":
case "ArrowRight":
SmarttoonViewer._aInstance[0]._moveNextCut();
break;
}
});
window.addEventListener("wheel", (ev) => {
if (ev.deltaY < 0)
SmarttoonViewer._aInstance[0]._movePreviousCut();
else if (ev.deltaY > 0)
SmarttoonViewer._aInstance[0]._moveNextCut();
});
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment