Last active
September 6, 2020 14:00
-
-
Save kwon37xi/7ae5715b6c9c539e0aa7da0f709392f9 to your computer and use it in GitHub Desktop.
dokuwiki linux-chrome accessKey change userscript
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 kwonnam wiki accesskey changer | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author KwonNam Son | |
// @match https://kwonnam.pe.kr/wiki/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
var newMappings = { | |
"`": "~", | |
"1": "!", | |
"2": "@", | |
"3": "#", | |
"4": "$", | |
"5": "%", | |
"6": "^", | |
"7": "&", | |
"8": "*", | |
"9": "(", | |
"0": ")", | |
"-": "_", | |
"=": "+" /*, | |
"b": "n", | |
"i": "?" - no need in vivaldi */ | |
}; | |
// execute after all DOM loaded | |
window.addEventListener('load', function() { | |
var buttons = document.getElementsByClassName("toolbutton"); | |
console.log("buttons : " + buttons.length); | |
var i; | |
for (i = 0; i < buttons.length; i++) { | |
if (buttons[i].accessKey) { | |
var accessKey = buttons[i].accessKey.toLowerCase(); | |
console.log("idx " + i + " " + buttons[i].accessKey); | |
if (newMappings[accessKey]) { | |
buttons[i].accessKey = newMappings[accessKey]; | |
} | |
} | |
} | |
}, false); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment