UserScript:ショートカットキー
customize - /customize/ページをランダムに切り替えるホットキー
code:script.js
$('body').on('keydown', function (e) {
if (e.target.tagName != "TEXTAREA" && e.target.tagName != "INPUT" && e.target.tagName != "A") {
if (e.key == 'r') {
document.getElementsByClassName('random-jump-button')0.click()
}
}
});
masui - /masui/新規作成ボタンを消す
code:script.js
$('body').on('keydown',function(e){ // Enterキーで新規ページ作成
if(e.target.tagName != "TEXTAREA" && e.target.tagName != "INPUT"){
if(e.key == 'Enter'){
var project = location.href.split('/')3;
location.href = /${project}/new;
}
}
});
うーん
code:script.js
addEventListener('keydown', e => {
if (!e.metaKey || e.key !== 'i') return
$('#text-input').focus()
})
code:script.js
addEventListener('keydown', e => {
if (e.ctrlKey && e.key === 'j') {
document.getElementById('text-input').focus()
}
})
Scrapbox:ショートカットキー
UserScript.icon
https://img.shields.io/badge/JavaScript-UserScript_ショートカットキー-F7DF1E.svg?logo=javascript&style=for-the-badge