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

[FR] Shortcut for Back/Forward menu popup #107

Open
rubaboo opened this issue Dec 25, 2024 · 1 comment
Open

[FR] Shortcut for Back/Forward menu popup #107

rubaboo opened this issue Dec 25, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@rubaboo
Copy link

rubaboo commented Dec 25, 2024

Is your feature request related to a problem? Please describe.
I often want to jump a few steps back in history, and there is no way to do it without using the mouse...

Describe the solution you'd like
I want to be able to invoke the tab history menu using Alt+Down combo.

Describe alternatives you've considered
This code does what I want when I paste it into Console. I don't know how to bind it to a key using a user script.

var btnF = document.getElementById("forward-button");
btnF.menupopup.openPopup()
@rubaboo rubaboo added the enhancement New feature or request label Dec 25, 2024
@aminomancer
Copy link
Owner

you can do it with fx-autoconfig's hotkeys API.

let details = {
  id: "myHotkey",
  modifiers: "alt",
  key: "ArrowDown",
  command: win => {
    let button = document.getElementById("back-button");
    if (button.disabled) {
      let fwdButton = document.getElementById("forward-button");
      if (!fwdButton.disabled) button = fwdButton;
    }
    win.gClickAndHoldListenersOnElement._openMenu(button);
  },
};

UC_API.Hotkeys.define(details).autoAttach({ suppressOriginalKey: true });

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

No branches or pull requests

2 participants