vimium icon indicating copy to clipboard operation
vimium copied to clipboard

Wikipedia and Github Issue preview popups remain open after using LinkHints.activateModeToOpenInNewTab

Open rnmhdn opened this issue 6 years ago • 9 comments

when I use f to click on a Wikipedia link(within the text) and then I open it in a new tab using shift and the corresponding letter for that link. the preview is opened and I can't close it unless I click on the page with my mouse. Please fix that so the preview won't open when one opens a link in a new tab.

rnmhdn avatar Jul 30 '18 13:07 rnmhdn

I can generate the same effect in Chrome.

The problem seems to be that we're generating a mouseover event, but not the corresponding mouseout event, here. Adding the mouseout event seems to fix the problem for me.

Might there be any unintended consequences if we add that event to the list?

smblott-github avatar Aug 10 '18 13:08 smblott-github

I can't really think of any unintended consequences.

rnmhdn avatar Aug 10 '18 19:08 rnmhdn

Maybe we can add a keydown handler to grab the next Esc to dispatch mouseout to the last clicked, when LinkHints clicks someone and exits. All other keys the handler receives should exit the handler itself and continue to broadcast.

Added: we need to keep the float panel showing when LinkHints exits, because a user may want to read something and click some things in the panel.

Therefore, I has another idea to deal with it: dispath an extra mouseout ONLY IF LinkHints is in OPEN_IN_NEW_FG_TAB mode and the source tab loses its foucs in 1 second.

gdh1995 avatar Aug 23 '18 08:08 gdh1995

Maybe we can add a keydown handler to grab the next Esc...

Yes.

smblott-github avatar Aug 23 '18 08:08 smblott-github

no news? :D

rnmhdn avatar Mar 07 '20 12:03 rnmhdn

Would the recently added Hover and Focus mouse events help with this, at least to be able to move away the focus using another keyboard shortcut? (see changelog for 1.66)

BachoSeven avatar Jul 10 '21 08:07 BachoSeven

In Vimium, action=hover applies hover and unhover on an Escape key, but a normal f command (LinkHints.activateMode) won't dispatch unhover (mouseout) events.

I have made a customized version of Vimium, named Vimium C, and it supports map f LinkHints.activateModeWithQueue autoUnhover to auto dispatch mouseout events. If you don't like to "unhover at once", you may press Escape (even without action=hover), or map a key to LinkHints.unhoverLast and then trigger the command manually.

gdh1995 avatar Jul 10 '21 09:07 gdh1995

So y'all don't use F on Wikipedia or what? The preview pops up and stays there... Really there need not any hover to begin with (?).

(Sorry if the tone feels snarky &c. Nothing wrong with being blunt. Just asking a question...)

Edit: I mean, the same thing happens on GitHub issues page. Like obviously this can't be the behavior we want?


On Wikipedia, when we hover the mouse pointer over an article link, a preview pops up.

  1. With the LinkHints.activateMode action=hover command, pressing Esc closes the preview.
  2. But with LinkHints.activateModeToOpenInNewTab (bound to F by default; opens a new tab for link in the background), the preview does not close with Esc.

So it appears to me we just need to apply the code for 1. to 2. Better yet, however, is to prevent the preview from popping up in the first place.

(Tested on Firefox.)

ropery avatar Jan 22 '24 07:01 ropery

@ropery I'm confirming that it's super annoying. I haven't looked into the ramifications of your suggestion, but on the surface it seems reasonable to me. "ESC triggers unhover" seems reasonable and intuitive.

I wonder if the rationale for not always unhover immediately is so that menus that disappear on mouseout will work with link hints?

philc avatar Jan 26 '24 07:01 philc

so that menus that disappear on mouseout will work with link hints?

Yes some webpages use popup card to show secondary menus and buttons, so unhovering should be optional.

gdh1995 avatar Feb 10 '24 10:02 gdh1995