forked from AmineB/ycombinator-keys
Compare commits
3 Commits
9a2b786bae
...
0f0a94d993
Author | SHA1 | Date | |
---|---|---|---|
0f0a94d993 | |||
3ee61aa074 | |||
6cc8a1a877 |
@ -5,7 +5,7 @@
|
||||
// @match *://news.ycombinator.com/*
|
||||
// @icon https://gitea.amine-bouabdallaoui.fr/AmineB/ycombinator-keys/raw/branch/main/icons/48.png
|
||||
// @grant none
|
||||
// @version 6
|
||||
// @version 7
|
||||
// @author AmineB
|
||||
// @description Ycombinator keyboard nav.
|
||||
// @downloadURL https://gitea.amine-bouabdallaoui.fr/brian6932/ycombinator-keys/raw/branch/main/keyboard-watcher.user.js
|
||||
@ -43,7 +43,9 @@ const
|
||||
query[selected].style.boxShadow = ''
|
||||
|
||||
while (selected < query.length && query[++selected].classList.contains('noshow'));
|
||||
highlightSelected()
|
||||
|
||||
if (!query[selected].classList.contains('noshow'))
|
||||
highlightSelected()
|
||||
return
|
||||
case 'k':
|
||||
if (selected <= 0)
|
||||
@ -51,7 +53,9 @@ const
|
||||
|
||||
query[selected].style.boxShadow = ''
|
||||
while (selected >= 0 && query[--selected].classList.contains('noshow'));
|
||||
highlightSelected()
|
||||
|
||||
if (!query[selected].classList.contains('noshow'))
|
||||
highlightSelected()
|
||||
return
|
||||
case 'h':
|
||||
if (globalThis.location.pathname === '/hidden')
|
||||
@ -62,7 +66,8 @@ const
|
||||
}
|
||||
else
|
||||
query[selected].nextSibling.querySelector('a.clicky.hider')?.click()
|
||||
if (selected + 1 <= query.length)
|
||||
|
||||
if (selected + 1 <= query.length && !query[selected].classList.contains('noshow'))
|
||||
highlightSelected()
|
||||
return
|
||||
case 'c':
|
||||
|
Loading…
x
Reference in New Issue
Block a user