tridactyl / tridactyl

A Vim-like interface for Firefox, inspired by Vimperator/Pentadactyl.
https://tridactyl.xyz
Other
5.18k stars 398 forks source link

Stuff Viumium-C does better #3066

Open bovine3dom opened 3 years ago

bovine3dom commented 3 years ago

From Reddit:

I only mean 2 things by that, but add a few more for a complete response.

  1. Many times with tridactyl unable to hint or "click" a link inside some iframes. For example go to lightnovelworld.com, choose a chapter from a random novel and try to click the play button on (Trinity Audio) using tridactyl, you can't.

    Also, I can't get out of a frame after select something inside with tridactyl, and that means I can't use any of tridactyl shortcuts anymore. For example, after ticking a checkbox with tridactyl the link below (vimium-c can't tick these), and nothing will work after that, thus I need to use vimium-c "nextFrame" or "mainFrame" function to regain control. https://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_input_type_checkbox

  2. Mouse over/hover simulation, yes I did try to use tridactyl to run a mouse-over javascript command, but it doesn't work really well. While with vimium-c that is really well-supported.

    • use LinkHints.activateModeToHover to hover things.
    • use LinkHints.unhoverLast to unhover the last thing you had hover
    • use LinkHints.activateModeToLeave to simulate mouse leaving an object on page, pretty useful if the above fail. It happens only like 1% of the time, though.
    • LinkHints.activateModeToHover also act pretty smart and auto-unhover the last hovered thing first before hovering the next thing.
  3. Scrolling, I want to scroll instantly after hitting the shortcut, meaning you should only use mouse up/down event to handle scrolling, not waiting the key repeat as in tridactyl. Also, when hinting, vimium-c has a different color for scrollable objects and frames, so I can easily choose with part I want to scroll, not only the main frame. Combine vimium-c features I can scroll the youtube sidebar, with seems impossible with tridactyl:

    • use LinkHints.activateModeToHover to hover something on the sidebar, so that Youtube think the mouse is on the sidebar and make the sidebar scrollable.
    • use LinkHints.activate scroll="force" (normal hinting) to select the sidebar
    • then I can scroll the sidebar.
    • to have the focus go back to the main section on youtube, I usually use tridactyl ";;" and focus some object.

https://www.reddit.com/r/firefox/comments/k7wvzc/vanilla_firefox_keyboard_mastery/gexvez2?utm_medium=android_app&utm_source=share&context=3

snippins commented 3 years ago

Welp, that was a lot of typos from me.

bovine3dom commented 3 years ago

On frames, yeah, it looks like we need to extract listening to key-events from the main content script and make a smaller one that goes into every frame and just listens for key events and sends them (somehow?) to the main content script on each page for parsing. https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/content_scripts#all_frames and https://github.com/tridactyl/tridactyl/blob/0fb54303c3fa73f6511cc71722b187f56125c6b8/webpack.config.js#L17

I'm not sure why lightnovelworld.com's play button doesn't work - our hints usually work within iframes. :/

You can press <C-,> to regain control of Tridactyl usually from an iframe (but you wouldn't need to if we did the fix above).

The repeated scrolling thing can be fixed once https://github.com/tridactyl/tridactyl/pull/1645 is merged, which is mostly waiting on me to fix one small but very annoying bug.

;; works for me for picking which part of YouTube to scroll (but it isn't very pretty). I did that this year so it's possible you just didn't know about it.

I haven't looked into hovering yet : )

snippins commented 3 years ago

For some reason "escapehatch" doesn't works for me, I has a few browermaps binds including "tabduplicate" (), "pin" (), "tabclose" (). I checked browsermaps and escapehatch is still <C-,>. Even tried resetting the browsermaps and it still doesn't work 😑, my custom binds still works though.

For the scrollling it turns out I need to use scrollline, I used scrollpx and that's why it didn't work.

Also somehow I even manage to scrolls the main section with vimium-c (C-j/C-k) and the scrollbar with j/k (tridactyl). 😅. I'am trying to find a way to reliable replicate the behavior*.

I'm using the beta version and just updated before testing.

Edit: To replicate (*):

bovine3dom commented 3 years ago

Also somehow I even manage to scrolls the main section with vimium-c (C-j/C-k) and the scrollbar with j/k (tridactyl)

;; does some extra stuff to tell Tridactyl (and only Tridactyl) what to scroll, so it's not surprising to me that you can get Vimium and Tridactyl to scroll different things : )

The only thing I can think of with <C-,> is that maybe you have another extension that is using it. Try binding it to a different key, or look on about:addons -> cog -> configure shortcuts and see if anything looks suspicious.

snippins commented 3 years ago

The C-6 bind to go to last tab was working, thus I decided unbind it and try to bind that to escapehatch, and escapehatch still doesn't work. But then I bind it to C-7 and it works. That's pretty weird.

bovine3dom commented 3 years ago

That's quite impressively weird. Does the "configure shortcuts" page under about:addons look weird at all?

snippins commented 3 years ago

Looks pretty normal

image

bovine3dom commented 3 years ago

What about viewconfig browsermaps? Run it from a real web page, not a special Tridactyl page.

snippins commented 3 years ago

Here you go

image

bovine3dom commented 3 years ago

Yeah, that looks normal too.

I'm running out of ideas. Are you running two versions of Tridactyl? There should only be one enabled in about:addons.

snippins commented 3 years ago

@bovine3dom Oops, you can forget about C-6 thing, it was never working for switching to last tab, I just thought it works since it coincidentally switched to the last tab in the test I did.

And the reason is that it's switching to the 6th tab, which is because I mapped Ctrl+6 to Alt+6 using autokey.

Still have no idea why C-, doesn't work but I have a feeling that it is my foul again so no worry. LOL.

bovine3dom commented 3 years ago

https://github.com/gdh1995/vimium-c/blob/a98f2cb0b212e3b29af06328e2d90aa3d289b4ee/content/link_actions.ts#L133 is Vimium-C's hovering code, I think. There's quite a lot of it so not a particularly quick thing to port to Tridactyl.

bovine3dom commented 3 years ago

adehen Well, yes. Vimium is a lot easier to use, I would say. The keybinds, for one. But mostly because the options aren't overwhelming. That said, it didn't take much to get used to it. However, I do like how Vimium handled scrolling behavior. And the frame switching by using the keybind "gf" Also, Vimium can handle Captcha, which was nice because I hate clicking on sidewalks for the nth time. Based on my experience, Tridactyl hasn't really been recognizing Captcha all that much. I apologize if I'm being particularly annoying about this. One last gripe I've had with it so far is how it handles scrolling when there are multiple scrollable frames.

bovine3dom Do you think it shouldn't change automatically?

adehen Uh, maybe keep it an option? I do appreciate the automatic switching, but it gets frustrating when I'm in something like Discord, and the server list scrolls up instead of the chat because the chat stopped scrolling to load. The same is true for Messenger. Also, this happens in the Tridactyl docs when I scroll down.

bovine3dom Yeah it's a totally reasonable request Could work really well with seturl

Some related comments from Matrix