Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: Krabby – A keyboard interface to the web, inspired by Kakoune (krabby.netlify.com)
179 points by alexherbo2 on Dec 15, 2019 | hide | past | favorite | 75 comments



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.


> 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.


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 [2]: https://github.com/girst/legacyfox


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!


I'm running Pentadactyl in Waterfox[0], which is a fork of the last good Firefox incorporating security updates from new Firefox. I can't vouch for how secure this really is in practice--perhaps the whole plan is a fool's errand--but it certainly works fine.

[0] https://www.waterfox.net/


> Try closing a tab or switch while the current tab is loading.

Simple: use the default shortcuts for this. The normal shortcuts coming with the browser out of the box are always available. Yes, they are not as nice to use as vim-bindings, but they are working.


"Doctor, my arm hurts when I do X"

"Then don't do X"


Vimperator / Pentadactyl gave a fantastic experience on Firefox. But the recent transition to WebExtensions killed them, which is really sad.

It's the only major regression I have ever experienced in my computing workflow. There's no good replacement, as browsers that provide a good keyboard-driven experience come with their own troubles as you explained.


Tridactyl is currently the best (Vimperator / Pentadactyl)-like extension around. It seems to be nicely done and is in TypeScript (and Python for the application (native messaging) part). You might want to give a try, if not already.

https://github.com/tridactyl/tridactyl


I use tridactyl and it isn't bad. I use the standard hotkeys to navigate forward/backward or to switch between tabs (unless I want to move to a far-away tab then i'll use 'b' so I can type in it's name to select). Because, as you said, the extension hotkeys don't work while the page is loading.

However, it works great for what I mainly use it for-- navigating up/down a page, and using f/gF/F to select links and open them or open in a new tab.


It seems that a lot of people are upset at browsers limitation's with custom keybindings. I thought I'd mention qutebrowser (https://qutebrowser.org/) which is a browser built using Qt (blink behind the scenes) around custom keybindings.

I'm using it right now and it's pretty great.


> It seems that a lot of people are upset at browsers limitation's with custom keybindings. I thought I'd mention qutebrowser (https://qutebrowser.org/) which is a browser built using Qt (blink behind the scenes) around custom keybindings.

> I'm using it right now and it's pretty great.

Is it your daily driver or do you use it in addition to Chrome/Firefox?


Problem with the smaller browsers like Qutebrowser is there are no real extensions.

If I could run Qutebrowser with uBlock it would be perfect.


Not the perfect solution, but I use NewTabTweaker [1] in FF set to redirect new tabs to DuckDuckGo. It works pretty well in combination with SurfingKeys, although I do occasionally need to use default FF keybinds, e.g. when a page fails to load.

1: https://github.com/rharel/webext-new-tab-tweaker


True, especially with firefox hanging on wayland I find it more painful to use it keyboardless.


vimium on firefox is very usable, you can replace blank tab with something else


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.


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


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.


Clicking the "Alt + Escape" text seems to do the trick. Firefox Nightly on Windows.


True, thanks. It was not obvious for me from the styling that I should click that.


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.


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...


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.


How does this compare to vimium?


You can try the live demo to compare.

https://krabby.netlify.com#live-demo


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... 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)


Are you using a different keyboard layout than the US?

Because Krabby uses physical keys.


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...

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


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...


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.)


The option is like a search always on?


The search bar isn't there unless you start typing, but yes, it's similar to having the cursor in the search bar. And tab works as it usually would, it's not as if you always start tabbing from the search box.


Can anybody who's tried this summarise the differences?



Unfortunately installing this browser extension requires piping curl to sudo bash to build it.


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.


If you refer to [#7], it is not true.

[#7]: https://github.com/alexherbo2/krabby/issues/7


What makes you think that? I don’t see anywhere mentioning doing that.


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?


There's been some activity in the gaming community for DIY solutions to track head movement. Or really any accessible way to get in-game head/camera rotation and/or tilting independent of what the mouse or keyboard is doing.

The simplest one is webcam face feed interpretation. It's also the least liked, because it's CPU/GPU intensive.

The most energy efficient one is based on small devices than measure distance between each other via radio signals or something similar. You put one of them on your head. It has the drawback of having to buy the (cheap) devices.

A middle-ground, which is probably the most popular solution, is a funny looking cardboard cutout with IR reflectors or lights that you put on a hat or headphones. Then you use a webcam feed, but its interpretation is much simpler, because the points to track are easily distinguishable.

All the webcam methods have a significant drawback that they require illumination. You either need lights on your head, or your face has to be brightly illuminated (visible light or IR). A light in my face is the last thing I want personally.


A practical analogue in emacs:

To open any link shown on the screen: 1. look at a visible link 2. press "o" + appeared keys to open the link

https://github.com/abo-abo/ace-link#usage

To move cursor to any place on the screen (keyboard as a mouse) e.g., https://github.com/abo-abo/avy#avy-goto-word-1


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


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-...


I have used https://eviacam.crea-si.com/ on a laptop successfully.


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


Everything else? X)

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


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).


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.


That's how Vimium works; f + letter clicks the link.


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.


There should be a different key for that then. The click action is the most important, so it should have its own dedicated key.


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


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


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...


I definitely appreciate the confirmation step when browsing around sensitive UIs like my company's AWS dashboard.


Sensitive operations should require confirmation on AWS, because you can click accidentally manually too.


To mitigate mistyping, the hint mode refuses to proceed invalid sequences too.


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


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


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


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/src/krabby/...


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


Vimari is a Safari port of Vimium and is available through the App Store: https://github.com/televator-apps/vimari


I currently use Shortcat, and it works well with Safari:

https://shortcatapp.com/


No. There is someone from IRC who wants it too, but I haven’t a Mac. So it’s unlikely to happen currently.


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


It's linked in the project page, but see: https://github.com/alexherbo2/krabby/blob/master/doc/differe...


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


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.


IANAL but I think it's trademark in this case.

Should have named it Frozen 2! :)


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


+1 for the trivia from a member of generation "Pre-Pokemon".


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


XD




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: