Last active
April 12, 2020 13:59
-
-
Save chidea/3ea515a554946d3001ca9f429d1c8612 to your computer and use it in GitHub Desktop.
etorrent.kr access key replacement (use greasemonkey fyi)
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 etorrent page navigation keybind | |
// @description press n to go to the next page and b for backward | |
// @homepageURL https://gist.github.com/chidea/3ea515a554946d3001ca9f429d1c8612 | |
// @updateURL https://gist.githubusercontent.com/chidea/3ea515a554946d3001ca9f429d1c8612/raw/etorrent.user.js | |
// @downloadURL https://gist.githubusercontent.com/chidea/3ea515a554946d3001ca9f429d1c8612/raw/etorrent.user.js | |
// @author ChIdea | |
// @version 0.2 | |
// @date 11/23/2017 | |
// @namespace chidea | |
// @match http*://*.etorrent.co.kr/bbs/* | |
// @include http*://etorrent.co.kr/bbs/* | |
// @include http*://*.etobang.co.kr/bbs/* | |
// @include http*://etobang.co.kr/bbs/* | |
// @include http*://*.etorrent.kr/bbs/* | |
// @include http*://etorrent.kr/bbs/* | |
// @include http*://*.etoland.co.kr/bbs/* | |
// @include http*://etoland.co.kr/bbs/* | |
// @grant none | |
// @license MIT License | |
// ==/UserScript== | |
function getButton(accessKey){ return document.querySelector('input[accesskey='+accessKey+']'); } | |
document.onkeypress=function(e){ | |
var ae = document.activeElement; | |
if(ae.tagName === 'TEXTAREA' || (ae.tagName === 'INPUT' && (ae.tagName === 'text' || ae.tagName === 'password'))) return; | |
var k = e.key; | |
if (k==='n' || k==='b') getButton(k).click(); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment