Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I've created a branch [here](https://github.com/mrmr1993/vimium/tree/right-click-linkhint) which should do the trick, using the LinkHints.activateModeToTriggerRightClickAction command. #3148

Open
benjamintrosen opened this issue Sep 24, 2018 · 3 comments

Comments

@benjamintrosen
Copy link

This seems like quite a low-demand feature, so I wouldn't expect to see it in the released version any time soon.

Originally posted by @mrmr1993 in #874 (comment)

@benjamintrosen
Copy link
Author

Hi can you explain to me how to implement the above command? I would like to be able to right click on a link in vimium. Thanks!

@mrmr1993
Copy link
Contributor

I haven't worked on Vimium in nearly a year, but I'll assume this is directed at me...

If you want to show Chrome's own context menu, I'm pretty sure that's still not possible using any method. However, that branch will trigger a javascript event handler set to intercept click/mousedown/mouseup events for a right mouse click or the contextmenu event.

If this is what you want, based on a quick look at ae829c8 (the commit in that branch) and current master, you should be able to:

  • apply the changes from background_scripts/commands.coffee directly
  • copy simulateContextMenuEvent that's added to lib/dom_utils.coffee
  • add the button parameter to simulateClick (as in that commit) and also pass it through to simulateMouseEvent, where it should replace the final 0 parameter to mouseEvent.initMouseEvent
  • add a check for button == 0 somewhere in this conditional
  • add the following to content_scripts/link_hints.coffee, near other similar lines:
RIGHT_CLICK = 
  name: "right-click"
  indicator: "Right click"
  linkActivator: (link) ->
    DomUtils.simulateClick(link, {
      altKey: false,
      ctrlKey: false,
      metaKey: false }, 2)
    DomUtils.simulateContextMenuEvent link
  • add RIGHT_CLICK to available_modes in content_scripts/link_hints.coffee
  • add activateModeToTriggerRightClickAction (count) -> @activateMode count, mode: RIGHT_CLICK near other similar lines in content_scripts/link_hints.coffee

I'm not interested in being involved with this, so I probably won't reply any further, but good luck!

@alexpattison
Copy link

+1 I would love to see this change. I use the web version of tons of apps specifically so I can use vimium to navigate. Sadly, some of them require right clicking to be fully functional (looking at you Spotify).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants