Hacker News new | past | comments | ask | show | jobs | submit login
Tridactyl: A Vim-like interface for Firefox (github.com/tridactyl)
128 points by RMPR 21 days ago | hide | past | favorite | 64 comments

I was an avid user of Pentadactyl[1], but the project died when the Firefox plugin changes[2] happened. From what I could tell at the time, all of the similar plugins like Vimium[3] suffered from severe limitations. For example, if your focus ended up on browser chrome you needed mouse clicks to escape.

Is this actually getting us back to something similar to Pentadactyl? I had assumed the plugin changes were preventing such control from being granted to plugins. Was I wrong, and it was just that the authors didn't port to the new framework?

[1] bug.5digits.org/pentadactyl

[2] https://support.mozilla.org/en-US/kb/firefox-add-technology-...

[3] https://vimium.github.io/

I think the main limitation is not being able to accept key presses from browser chrome. Mozilla in principle was prepared to accept a patch that added a new API that did that [1] but people have repeatedly lost interest in developing it - the reward for getting it working being a months-long negotiation with Mozilla to get it merged probably doesn't make it appealing to many. The API would also fix some but not all instances of not being able to use Tridactyl until the page has loaded.

Recently, we have added an escape hatch where if you press ctrl-, focus returns to the page even from browser chrome. This works even on special pages like "we could not load this page" where it returns you to a page where Tridactyl can run. I've trained myself to use it instead of escape and it feels quite natural. On every platform except Windows ctrl-6 now takes you to the previous tab everywhere, even on pages to which we don't normally have access. Users can add their own octopus-style binds which are accessible everywhere but the criteria for what works are unfortunately quite opaque.

I personally think the biggest problems for Tridactyl are in the future. Manifest v3 proposes heavily restricting the use of `eval` which our users use a lot for writing their own little scripts. I don't think it would be insurmountable, but Tridactyl already has its own little DSL, so we would probably run afoul of the spirit of the new rules and risk getting delisted or banned. We might have to take most of the coolest features of Tridactyl out (and maybe have a contrib/ part of the source where anyone can have their own scripts merged without too much review).

The other problem is that new web extension APIs tend be gated behind a very narrow definition of "user intent" - essentially, the user clicks on your extension button or presses an octopus-style keybind (like ctrl-,) - that excludes about 99% of the intent of Tridactyl users. A recent example of this is the new "optional permissions" where an extension can ask for permissions as it needs them; Firefox requires you can convince it that you have user intent or it will not allow you to ask for more permissions. (Incidentally, the keyboard API I mentioned above would allow us to prove user intent to Firefox in some limited circumstances).

So in summary: yeah, there are limitations. Lots of them could be fixed by working with Mozilla but no one has yet been motivated enough. In practice it's not as bad as it sounds.

[1]: https://github.com/tridactyl/keyboard-api

There are multiple XUL based Firefox forks, e.g. Pale Moon, Waterfox, Basilisk. They should all work well with Pantadactyl.

But note their security patch is maintained by volunteers outside of Firefox team, and may not be the best of state.

There are a lot of limitations and the addon class will never be as good as it used to be. Solutions are to either use an old FF, different version, or fork that supports them. I still have an okay time doing this, but it probably won't work forever.

This seems a common sentiment for Firefox users: enjoying the amazing productivity of custom tailored environment with carefully chosen extensions, but knowing our days are numbered.

Tridactyl worked for me better than any alternatives, but qutebrowser (https://qutebrowser.org/) was built for this kind of browsing and is more configurable. Unfortunately it doesn't have good plugin support, although I believe it does have an inbuilt ad blocker.

Yup - note the built-in adblocker is very basic at the moment (just a list of blocked hosts which doesn't block e.g. YouTube ads or ads served from the main domain of a page).

This is going to change soon, however, with a new adblocker based on Brave's: https://github.com/qutebrowser/qutebrowser/pull/5317

I hesitated long to make qutebrowser my main browser because of lacking password management and device synchronization. Eventually I switched and started using dedicated applications for these tasks.

Qutebrowser is especially great for browsing documentation while coding. Besides it's main point of being keyboard driven, the lack of plugins makes it also absolutely distraction free.

FWIW there are userscripts to integrate password management with qutebrowser: https://github.com/qutebrowser/qutebrowser/tree/master/misc/...

What are you using for device synchronization? Something like Syncthing/Nextcloud?

Imho tridactyl's hint mode is better than qutebrowser's

Can you elaborate? Maybe there's something to learn for qutebrowser's hint implementation :)

I can't answer for OP but I think Tridactyl's callback hint mode is more powerful than Qutebrowsers' spawn, as we provide the hinted element to the callback. That means you can do stuff like remove it from the page or make the font comic sans etc. Qutebrowsers' spawn hint mode seems to only let you use the URL of the hint.

In general we seem to have more hint modes - copy paragraph to clipboard, select text, etc. See https://github.com/tridactyl/tridactyl/blob/5e8f94ff06bd5f14... (and forgive the code ... we really need an argument parser).

Yep, qutebrowser should also have some more hinting modes :D https://github.com/qutebrowser/qutebrowser/issues/521

You can't really write Python well inline (as an oneliner), so custom hints would look a bit different in qutebrowser, as a separate Python extension which would be loaded from a file: https://github.com/qutebrowser/qutebrowser/issues/30

I agree it'd be great to have a bit more flexibility with regards to hinting actions!

Why not optionally use JavaScript for the callback?

Somehow you were able to express exactly what I wanted to say with less words and less pictures https://news.ycombinator.com/item?id=24637140

Edit: Thanks for Tridactyl, it's a great add-on and truly a life changer, and I just started using it 2 or 3 days ago :)

First of all, thanks for qutebrowser, it's a really great piece of software, in fact I'm using writing this comment using it... Now for the hints, it's mainly the fact that tridactyl highlights the elements hinted, for example with the Twitter web UI:

tridactyl: https://imgur.com/D1PDBgY

qutebrowser: https://imgur.com/m4vtbk0

Now it's not that a big deal, but the advantages appears clearly on more saturated pages, off the top of my head, stackoverflow's triage:

With qutebrowser[0], if I want to close the modal, `gs` and `hd` are almost on the same place (it's only with experience that I noticed that hints are top left so `hd` is the hint I'm looking for) compare this to tridactyl[1] the `hy` fits very nicely with the highlight which doesn't let any place for ambiguity. I noticed your other answer about the addons, it's very much appreciated, and if I can help with the beta or whatever, let me know, keep up with the great work.

0: https://imgur.com/H4oGufK

1: https://imgur.com/NyNyOoX

If Qutebrowser wants to stop its hints from overlapping, it might be helpful to look at the PR that added it to Tridactyl: https://github.com/tridactyl/tridactyl/pull/2259/files : )

Thanks! I added a comment to the relevant qutebrowser issue: https://github.com/qutebrowser/qutebrowser/issues/71

Thanks! I added a comment to a somewhat related issue: https://github.com/qutebrowser/qutebrowser/issues/2836

I'm a novice vim user, so it's a learning curve to be sure (I mean, perhaps it is anyway since it's applied to a browser instead of a text editor). But I love this addon for the same reason I learned to love vim: it really is just faster to do all kinds of manipulation with just the keyboard. I'm not a developer by trade but I found writing and editing prose documents (typically usability reports and documentation) faster and easier with vim. This makes browsing similarly easier and the hints mode is fantastic for websites with shit UI.

Now whenever I use something like discord to talk with my gaming friends I find myself wanting the same keybindings.

Tbh you don't really need to know Vim to get the most out of this extension, sure already knowing Vim keybindings is advantageous, and it provides a kind of homogeneity, but it's not needed plus you can even learn new keybindings.

Huge Tridactyl fan here, it works beautifully. I am using it for over a year, ever since I spotted its mention at Suckless 'rocks' page: https://suckless.org/rocks/

Only kind of on topic, but a few weeks ago I read a comment here (but can't find it again). I think it's worth repeating though.

You don't need to love or use Vim to benefit from it. Just learning the keybinds is a great thing, because you can most likely find Vim bindings for any popular system.

So though you never use Vim, whatever you pick up next can use the same bindings you're used to.

I've used Tridactyl (as well as similar other plugins) in the past, but eventually I found myself having to disable it on a lot of websites due to poor interaction with web site keybindings.

Then why stop using it?

The only website keybinding that really frustrates me is /, which many sites bind to their search feature. I don't understand why they do that. Don't web browsers already have page navigation features? Either the user is a mouse maid and can click the search field themselves, or they have a keyboard navigation tool such as Tridactyl and the binding just overrides the tool.

I think page-specific keyboard-driven navigation has advantages. For example, in Gmail j/k navigates between email threads. I can't see that Tridactyl provides this functionality.

For the search functionality specifically, I guess it's possible to find a solution. The page-specific search shortcut will just focus a specific element on the page, and maybe that could be provided on a different shortcut in addition to /.

You can use unbindurl, so you can unbind tridactyl's j/k on mail.google.com, for example. Keys not bound in tridactyl are passed through to the page.

Because once it's disabled on some sites, I get annoyed by the inconsistent interface.

If it's just one or two binds that are causing issues on a site you can unbind them with `:unbindurl`.

Have you tried qutebrowser? Also I suggest you to give tridactyl another try, it vastly improved, especially the hint mode, plus you don't really have to disable the extension if it gets in your way, just switch to "ignore mode" and voilà

Tridactyl user for the last few months, it has made my browsing experience so much more pleasurable.

I pair it with a custom userChrome.css which removes the tab bar (I use 'b' to view and access tabs whenever I need them), affording me more vertical real-estate.

My only gripe was that the search navigation with C-g(?) was very clunky and painful so I unbound C-f and it works just fine now. I'm sure that's a matter of personal preference, though.

can you please share details about your setup?

for example, can you share the content of the userChrome.css and the trydactyl configuration needed to bind 'b' with the toggle action?

As bovine3dom has mentioned already, b is the default keybind.

For userChrome, I use https://github.com/MrOtherGuy/firefox-csshacks/blob/master/c...

Not my GitHub, but incredibly useful repo for all kinds of userChrome shenanigans. Personally I keep it to a minimum (literally just this hack) so that I have less stuff to look at if an update breaks something.

b is the default bind for filtering and selecting tabs, so no configuration is needed there.

We offer some help with userchrome via `:guiset` which I personally use, but you should beware that Mozilla break it fairly often (maybe once every 6 months) with updates.

I really want to use things like this, but the permissions model is scary, it wants access to everything.

I'm sure most plugins are benign, but it might not be

I felt/feel the same, but I am greatly comforted by the add-on making an attempt to clearly communicate what it uses/needs each of those permissions for: https://addons.mozilla.org/en-US/firefox/addon/tridactyl-vim...

Even though there’s no guarantee that the explanation corresponds exactly to what is implemented behind the scenes, this unusual pattern of user respect and consideration makes the add-on/developers feel more trustworthy than other sketchier ones.

This is about the only type of addon that genuinely needs full access to everything - the type that replaces your browsing interface. It needs to be able to interact in all the possible ways with every single element on the page. There's no way around it having scary powers, because using them is its base purpose.

I'm really glad that other people feel that permissions over-reach is a problem.

Specifically in the case of Tridactyl, as an interface to the entire webbrowser is needs access to the entire web browser. It does manage bookmarks, it does modify webpages (by adding link hints).

It's open source, just read it and use the source-code release https://github.com/tridactyl/tridactyl

Is it possible to validate what I am running in browser is an unaltered version of what is there in Github?

Otherwise, I will have to trust the package author to not be malicious.

Another option might be to personally package and sideload the extension which I don't know how.

Yes, that's what I meant! It's very easy to sideload.


Tridactyl exists in the Arch community repos [1] if you would rather use that; you're effectively shifting your trust to an Arch trusted user away from some random person (me) and Mozilla.

[1]: https://www.archlinux.org/packages/community/any/firefox-tri...

I’ve never used Tridactyl, but I switched from vim vixen to qutebrowser and found the full browser allows a much deeper vim integration and customization than a plugin ever could.

I’d highly recommend checking out qutebrowser if you are interested in this type of thing.

One thing that made me stick to tridactyl is the lack of addon support in qutebrowser, and I don't use that much addons: privacy badger, multi containers (especially this one), cookie auto delete and unlock origin ...

For at least some of those, there are plans to add support natively to qutebrowser:

Containers: https://github.com/qutebrowser/qutebrowser/issues/4102

Better adblocker: https://github.com/qutebrowser/qutebrowser/pull/5317

I'm still not sure what exactly Privacy Badger really does under the hood, but I suspect much of it won't be possible with QtWebEngine's API.

Not sure about Cookie Auto Delete - I fear it's not possible to implement either, but I'm not entirely sure, I've always found the QtWebEngine cookie APIs quite confusing so I'd need to take a closer look.

There's also SurfingKeys[1].

[1]: https://github.com/brookhong/Surfingkeys/

And a handful more: https://github.com/qutebrowser/qutebrowser#active (Vimium-FF, Vim Vixen, VVimpulation, Krabby)

If you use vim-vixen, consider giving tridactyl a try, it is one level above in terms of browser integration, I say this as an ex Vim-vixen user.

One example is using a custom search engine, with vim-vixen it'll just continue to use Google while tridactyl works fine, I also like how it highlights the elements targeted by the letters when you press 'f'

> One example is using a custom search engine, with vim-vixen it'll just continue to use Google while tridactyl works fine,


I'm using vim-vixen with DuckDuckGo without problem. I just have "duckduckgo" set in search.default

What I call a custom search engine is something not in the default, like this one: https://searx.privatenet.cf/ I wasn't able to make it work, as a side note, I changed my search engine after installing vim-vixen, so its probably why it didn't work.

Anybody know how this differs from Vimium extension?

Before tridactyl, I used vimium and vim-vixen, this is the best one hands down. In terms of integration with Firefox and links recognition.

I'm trying it out just now after having used vimium for the longest time, and I like it, but it randomly doesn't support upvotes on this site. I'm sure there will be other cases it doesn't support for some reason. But it definitely has more features than vimium.

I am surprised that it doesn't support upvotes here (perhaps this gives away how stingy I am with upvotes). If you have time could you file an issue? https://github.com/tridactyl/tridactyl/issues/new

Thanks : )

I looked at a few things including tridactyl when web extensions took out vimperator. After seeing the demos, I settled on giving https://krabby.netlify.app/ a try.

Copying all the links from a table in a go without doing some console fiddling is kinda nice when you need it.

Nice extension. For the love of GOD do not hijack my "new tab" page and focus on the page instead of the URL bar.

That is SUPER ANNOYING. There should be a button to disable this behaviour very clearly on the page.

I addressed this preemptively earlier today [1]. As it happens, I would also like to enable or disable new tab pages without disabling an extension entirely. Perhaps you could file an issue with Mozilla asking for this functionality? I'd integrate it into Tridactyl in an instant if I could.

Regarding the focus stealing: having focus on the page was one of our most requested features. Unfortunately it isn't trivial to have it be optional.

[1]: https://news.ycombinator.com/item?id=24615963

Coming from vim-vixen, I must say this is dope, some people complain about the new tab default change after installing this extension, but I find it fine tbh.

Enough people complained + someone cared enough to help out, so we now offer a build without a new tab page [1]. Migration between the builds is much the same as the process documented here [2].

[1]: https://tridactyl.cmcaine.co.uk/betas/nonewtab/tridactyl_no_...

[2]: https://github.com/tridactyl/tridactyl/wiki/Migration-from-s...

Hint mode is a great idea! I wish it was supported at the OS level...

There is a young project that does this for macOS [1]. I think I remember seeing a similar project for GTK but I might have imagined it.

[1]: https://github.com/dexterleng/vimac

Oh thank you, that's quite nice actually! Will keep it in mind next time I get my hands on a mac.

There is actually an app like this for macos that supports hint mode and is made for navigating everything with your mouse.

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