0

I'm using the Right Click Opens Link New Tab Correct Order chrome extension, it allows me to right-click on links to directly open them in a new tab.

To get the context menu, I have to right-click while holding the Shift key, but I want to use Alt instead, i.e. Alt + Right Click to open the context menu.

I have tried the following hotkeys, they all failed:

!RButton::+RButton
!RButton::Send +{RButton}
!RButton::Send +{Click Right}

The only hotkey that works is this:

Alt::Shift

But it will break shortcuts like Alt+Tab etc. Is there a way to achieve this without unintended side effects?

Wenfang Du
  • 8,804
  • 9
  • 59
  • 90
  • 1) Try prefixing with `$` e.g. `$!RButton::`, 2) try forcing a hook e.g. `Alt & RButton::` – wOxxOm Oct 04 '21 at 05:13
  • @wOxxOm Thanks for stopping by, I tried both `$!RButton::Send +{RButton}` and `Alt & RButton::Send +{RButton}`, but unfortunately, they didn't work. – Wenfang Du Oct 04 '21 at 08:34
  • IIRC hooking may need two rules, one for `RAlt` and another for `LAlt`... – wOxxOm Oct 04 '21 at 08:46
  • @wOxxOm Not sure why, but `LAlt & RButton::Send +{RButton}` breaks Alt+Tab. – Wenfang Du Oct 04 '21 at 08:59
  • Something like this should really be changed in the source code of the extension. Not via implementing yet another hack with something else. Anyways, seems like the extension already allows you to use either `shift`, `ctrl`, or `alt` to open the right click menu (line 77 in `content_script.js`), so yeah.. – 0x464e Oct 04 '21 at 10:06
  • @0x464e Thanks for the pointer, I realized I could see the source code via [this approach](https://stackoverflow.com/a/14544700/7881859). And I saw the `if (!(evt.altKey || evt.shiftKey || evt.ctrlKey))` condition on line 44 for determining whether to open the context menu, from my testing, `ctrl` and `shift` did work, but somehow `alt` didn't, I tried the three modifiers on Edge too, it produced the same result. – Wenfang Du Oct 04 '21 at 10:59
  • 1
    I guess it's because pressing `alt` activates another part of the browser and therefore dismisses the right click menu. If you release `alt` right as you right click, it should be fine. – 0x464e Oct 04 '21 at 13:41

0 Answers0