
Show HN: Krabby – A keyboard interface to the web, inspired by Kakoune - alexherbo2
https://krabby.netlify.com
======
brokenkebab
All extensions in this field are very limited by all major browsers' security
policies which prohibit, for example, user-defined keybindings on a blank tab.
I found more satisfying mouseless experience only with specially crafted
browsers like qutebrowser. But they come with their own troubles :( Would be
really great for FF, and Chrome(ium) to make keybinding assignment more
flexible instead.

~~~
unicornporn
> All extensions in this field are very limited by all major browsers'
> security policies which prohibit, for example, user-defined keybindings on a
> blank tab

This is the correct answer. Attempts like these futile.

You can not properly control the UI while a page is loading which makes the UX
godawful. Try closing a tab or switch while the current tab is loading.
Sometimes it works, other times not. With legacy VimFX you coulf also access
all buttons in the browser UI toolbar.

Was a VimFX user and the switch to WebExtensions was the greatest step back in
browsing I've ever experienced. Tried to remedy this by running legacy
extensions in Pale Moon. But that's not a way forward as these alt browsers
are not secure. Actually, I'm toying with the idea of sandboxing alt browsers
to be able to browse fast with my fingers on the keyboard again.

~~~
girst
I am btw still maintaining VimFx[1], and you can run it in current versions of
Firefox with a shim[2].

[1]:
[https://github.com/akhodakivskiy/vimfx/releases](https://github.com/akhodakivskiy/vimfx/releases)
[2]: [https://github.com/girst/legacyfox](https://github.com/girst/legacyfox)

~~~
unicornporn
Ha, you're here! I ran your updated versions in WaterFox for awhile. Was very
happy and it worked perfectly. Thanks! I believe I read something back then
about WaterFox eventually also phasing out XPCOM extensions.

Did not know about the shim. Will give it a try. You just gave me some new
hope. Thanks again!

------
dmortin
It's too bad the live demo uses Alt-Escape to activate which is a shortcut
used by Windows, so I can't try it without installing it.

The author should use some other shortcut or put an Activate button on the
page so Windows users can also try it.

~~~
alexherbo2
I added a note to tell users they can click on the keys themselves to run the
commands.

~~~
lucb1e
The alt combinations (other than alt+esc to activate) don't work for me. I
thought it was because they were captured by the browser or something, but it
also does nothing when clicking on them.

And isn't alt+space a global combo in most major OSes? (Window operations in
Windows and most Linux distros, and some system dialog in macOS if I'm not
mistaken, though that might have been cmd+space.) I use it frequently (mostly
to minimize windows but also for other things), and while most people may not
do that, I think this extension targets exactly the audience that would. Seems
like an odd choice.

------
wingerlang
I remember using some vim extension but I always found the "hint" being a
random character annoying, I briefly used vimperator (iirc) which allowed to
fuzzy search elements to focus on which was waaaay better.

------
jiri
Web definitely needs a better keyboard interface, this seems interesting but
it looks a bit difficult to learn and use.

I used and liked Gleebox quite intuitive, easy and powerful. But it is not
developed anymore.
[https://chrome.google.com/webstore/detail/gleebox/miinkdcjgl...](https://chrome.google.com/webstore/detail/gleebox/miinkdcjglbkbanpkghnkgkgbamdkgji)

~~~
alexherbo2
Wow, gleeBox looks cool. Never heard of it before.

Does selection act at the structural level of the document, or are they
applied to links only? In the video, he seemed only selecting links, and doing
actions one by one.

------
Gratian
How does this compare to vimium?

~~~
alexherbo2
You can try the live demo to compare.

[https://krabby.netlify.com#live-demo](https://krabby.netlify.com#live-demo)

~~~
lucb1e
The demo doesn't work very well for me, most of the alt combinations don't
seem to do anything (alt+escape to activate works though, luckily). Might need
to install the extension to try it out after all.

So far I like the precise scrolling with j/k, going up and down with G/g,
jumping to a point of interest (link, image) with f, focusing input boxes with
i, and yanking (copying) the focused link (or the page's url if nothing is
focused) with y. The parts that work in the live demo, work really nicely.

Personally I have "search when typing" enabled in Firefox which enables
navigation like this:
[https://preview.redd.it/jial7j6lbppz.gif?width=1024&format=m...](https://preview.redd.it/jial7j6lbppz.gif?width=1024&format=mp4&s=53fc89ad51c0c64b66fda98985e78a4e556b115f)
It isn't as mouse-free as this extension aims to be, but it goes a long way
already with no extensions and only a tiny learning curve (to learn some
tricks like searching for the text next to a button or field and hitting
(shift+)tab). For example, I typically upvote HN comments by typing part of
the person's username, shift+tab+tab, enter. Looking for my own post is
typically just typing the word "edit".

(Firefox 71, Linux)

~~~
alexherbo2
Are you using a different keyboard layout than the US?

Because Krabby uses physical keys.

~~~
lucb1e
US, no dead keys. I do have a UK physical layout though, but aside from < and
\ everything is in the same place so alt's and escape's keycodes shouldn't
have changed.

The symbols as they are printed on my keyboard matches what Wikipedia calls
the Linux US layout[1], but I'm pretty sure I bought this in the Netherlands
and an ordinary Logitech K200 will not have custom Linux prints on it, so I'm
a bit confused. There also exists a Dutch layout with the same physical keys
but a different keymap[2], so that's not it.

Trip down memory lane: until Vista, Windows in Dutch shipped with the Dutch
and US keyboard layouts both enabled (US was the default) and ctrl+shift as
switching hotkey. People would randomly get plusminus symbols when they tried
to type a colon because they had accidentally switched to the Dutch layout,
which was printed on exactly nobody's keyboard. It happened so often that
people would just roll with it, and I think it was generally understood among
the heavier computer users that plusminus was supposed to be a colon.
Sometimes, someone would reply to such messages: "press ctrl+shift and try the
colon again". That person was then thanked profusely. Those were the days.

[1]
[https://en.wikipedia.org/wiki/British_and_American_keyboards...](https://en.wikipedia.org/wiki/British_and_American_keyboards#/media/File:LinuxUSKeyboard.png)

[2]
[https://nl.wikipedia.org/wiki/Toetsenbord_(computer)#/media/...](https://nl.wikipedia.org/wiki/Toetsenbord_\(computer\)#/media/Bestand:NL_toetsenbord_groot.PNG)

~~~
alexherbo2
I don’t know what to say. Internally, Krabby uses KeyboardEvent.code with a
layer (US by default) for the display.

[https://developer.mozilla.org/en-
US/docs/Web/API/KeyboardEve...](https://developer.mozilla.org/en-
US/docs/Web/API/KeyboardEvent/code)

~~~
lucb1e
So I guess that should work then? Most of my keycodes should be the same as
anyone from the USA and the demos on the page you linked work perfectly (the
WASD game as well as the key combo listener that displays alt+j or whatever
just fine).

(Since I can't edit my previous post anymore: ignore the mention of the escape
key, alt+esc is actually the only alt combo that works.)

------
iudqnolq
Unfortunately installing this _browser extension_ requires piping curl to sudo
bash to build it.

~~~
iudqnolq
Correction: building the extension requires installing a programming language
with sudo bash because the extension needs to communicate with a native app.

I completely retract what I said.

------
dmortin
For link selection the quickest way could be eye tracking, that is your
laptop's camera would track your eye and you could press some key to go to the
link which you are looking at.

Is there some application which does this?

~~~
faeyanpiraat
Unfortunately built in webcams do not have sufficient resolution and low
enough latency to be suitable for this purpose.

~~~
dmortin
Maybe it could be worth it to buy a proper external camera for this purpose if
one has a desktop or uses one's laptop most of the time stationary.

I searched for it and apparently Windows 10, for example, has optional eye
tracking control built in already:

[https://support.microsoft.com/en-
us/help/4043921/windows-10-...](https://support.microsoft.com/en-
us/help/4043921/windows-10-get-started-eye-control)

------
nathias
I like the smoothness of j/k, but everything else vimium does better...

~~~
alexherbo2
Everything else? X)

What do you mean by “everything else”? Approaches are quite different, so I
need more details.

~~~
nathias
I like to scroll between tabs with J/K, go down the page with d, and the input
controls with gi, ge, I also prefer the clicking on links requires less
actions, I think krabby could do like a ctrl+f to select with more options and
just f to use the default selection. I would also prefer it if it were closer
to vim (with H,L, zz, functionality and generally follow the principle of
different modes for different functions).

------
dmortin
It's strange that you have to press enter too after selecting a link to go
there. The most frequent task of browsing is clicking on links, so it should
be only f + hint, without any additional keys.

~~~
jedimastert
I'd say mouse-ing over a link is a different action than clicking it. Say you
want to read the alt test, or see where the link goes.

~~~
uryga
maybe there should be two keybindings for mousing-over and clicking, i'd say
hovering is relatively rare in comparison

~~~
jedimastert
Maybe? I don't know if there's defined behaviour JS wise for a "click" event
not following a "mouseover" though.

~~~
blotter_paper
There is, you can trigger click events from JavaScript without a mouse going
over the element: [https://developer.mozilla.org/en-
US/docs/Web/API/HTMLElement...](https://developer.mozilla.org/en-
US/docs/Web/API/HTMLElement/click)

------
fiatjaf
Please, provide installable packages! I want to use it, but I don't want to
have to install tons of dependencies.

~~~
alexherbo2
The only build dependencies are jq and Crystal (eventually Zip, but it’s
unlikely you don’t have it).

------
leshokunin
This is cool. Are you planning on making something equivalent as a lib? Would
love an easy way to use this in React.

~~~
alexherbo2
It is already the case, because all features are implemented as a lib (Krabby
just holds the configuration).

[https://github.com/alexherbo2/krabby/blob/master/doc/configu...](https://github.com/alexherbo2/krabby/blob/master/doc/configuration.md#files)

[https://github.com/alexherbo2/krabby/blob/master/src/krabby/...](https://github.com/alexherbo2/krabby/blob/master/src/krabby/web/krabby.js)

------
ihodes
Is there something like this that's currently developed for Safari?

~~~
johanlarsson
Vimari is a Safari port of Vimium and is available through the App Store:
[https://github.com/televator-apps/vimari](https://github.com/televator-
apps/vimari)

------
fhennig
What is meant by "Subject–object–verb order" as a tag here?

~~~
jml7c5
It's linked in the project page, but see:
[https://github.com/alexherbo2/krabby/blob/master/doc/differe...](https://github.com/alexherbo2/krabby/blob/master/doc/differences-
with-vim.md#a-linguistic-twist)

------
WilliamEdward
Why do people think they can just name their products after copyrighted
content?

~~~
blotter_paper
Because The Pokémon Company is unlikely to sue (or even notice) such a
marginal and unrelated project, I'd guess. Even if they do notice, a cease and
desist letter seems more likely than an actual lawsuit; even in cases of clear
substitute goods like AMR2 Nintendo prefers to send cease and desist letters
first, I'm sure they don't want the bad press of suing fans. For something
like Krabby, this would result in a simple name and logo change. Many people
don't have ethical objections to this behavior, so the only thing stopping
them would be the potential for actual legal action.

------
mstade
My nephew is a big Pokémon fan and I instantly recognized both the name and
logo:
[https://www.pokemon.com/se/pokedex/krabby](https://www.pokemon.com/se/pokedex/krabby)

~~~
lucb1e
I think that is expected to be generally known, pokémon fan or not.

~~~
alexherbo2
XD

