Skip to content

Instantly share code, notes, and snippets.

@egormanga
Created January 10, 2019 02:19
Show Gist options
  • Select an option

  • Save egormanga/b15040eb1103a2be678a9e231b2b2323 to your computer and use it in GitHub Desktop.

Select an option

Save egormanga/b15040eb1103a2be678a9e231b2b2323 to your computer and use it in GitHub Desktop.
Attachments scrolling on 2ch.hk with mouse wheel
// ==UserScript==
// @name DvachScroll
// @version 0.1
// @description Attachments scrolling on 2ch.hk with mouse wheel
// @author Sdore
// @match http://2ch.hk/*
// @match https://2ch.hk/*
// ==/UserScript==
(function() {
console.log('[DvachScroll] Started');
MExpandMedia.onwheel = function(e) {
e.preventDefault();
let evt = window.event || e;
evt = evt.originalEvent?evt.originalEvent:evt;
MExpandMedia.onkeyup({keyCode: (evt.detail?-evt.detail:evt.wheelDelta)>0?37:39});
};
console.log('[DvachScroll] Patched');
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment