Skip to content

Instantly share code, notes, and snippets.

@chidea
Last active April 12, 2020 13:59
Show Gist options
  • Save chidea/3ea515a554946d3001ca9f429d1c8612 to your computer and use it in GitHub Desktop.
Save chidea/3ea515a554946d3001ca9f429d1c8612 to your computer and use it in GitHub Desktop.
etorrent.kr access key replacement (use greasemonkey fyi)
// ==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