forked from AmineB/ycombinator-keys
Compare commits
1 Commits
e04ab7aacc
...
rewrite
Author | SHA1 | Date | |
---|---|---|---|
428c967255
|
@ -5,11 +5,11 @@
|
|||||||
// @match *://news.ycombinator.com/*
|
// @match *://news.ycombinator.com/*
|
||||||
// @icon https://gitea.amine-bouabdallaoui.fr/AmineB/ycombinator-keys/raw/branch/main/icons/48.png
|
// @icon https://gitea.amine-bouabdallaoui.fr/AmineB/ycombinator-keys/raw/branch/main/icons/48.png
|
||||||
// @grant none
|
// @grant none
|
||||||
// @version 10
|
// @version 4
|
||||||
// @author AmineB
|
// @author AmineB
|
||||||
// @description Ycombinator keyboard nav.
|
// @description Ycombinator keyboard nav.
|
||||||
// @downloadURL https://gitea.amine-bouabdallaoui.fr/brian6932/ycombinator-keys/raw/branch/main/keyboard-watcher.user.js
|
// @downloadURL https://gitea.amine-bouabdallaoui.fr/AmineB/ycombinator-keys/raw/branch/main/keyboard-watcher.user.js
|
||||||
// @updateURL https://gitea.amine-bouabdallaoui.fr/brian6932/ycombinator-keys/raw/branch/main/keyboard-watcher.user.js
|
// @updateURL https://gitea.amine-bouabdallaoui.fr/AmineB/ycombinator-keys/raw/branch/main/keyboard-watcher.user.js
|
||||||
// ==/UserScript==
|
// ==/UserScript==
|
||||||
// jshint esversion: 11
|
// jshint esversion: 11
|
||||||
|
|
||||||
@ -38,8 +38,7 @@ const
|
|||||||
query[selected].lastChild.firstChild.firstChild.focus(focusInvisible)
|
query[selected].lastChild.firstChild.firstChild.focus(focusInvisible)
|
||||||
},
|
},
|
||||||
keydown = event => {
|
keydown = event => {
|
||||||
if (input.has(globalThis.document.activeElement.tagName))
|
if (!input.has(event.target.tagName))
|
||||||
return
|
|
||||||
switch (event.key) {
|
switch (event.key) {
|
||||||
case 'j':
|
case 'j':
|
||||||
const lastIndex = query.length - 1
|
const lastIndex = query.length - 1
|
||||||
|
Reference in New Issue
Block a user