Skip to content

Instantly share code, notes, and snippets.

@kba
Last active February 6, 2024 01:58
Show Gist options
  • Save kba/6719dc03e6c75f1fc25f8fa34a2360d1 to your computer and use it in GitHub Desktop.
Save kba/6719dc03e6c75f1fc25f8fa34a2360d1 to your computer and use it in GitHub Desktop.
Tampermonkey keyboard cheat sheet

Found by grepping through the JS of Tampermonkey BETA 4.1.5180

Builtin shortcuts

Key combo Context Action Notes
Alt-Right Dashboard Next Tab
Alt-Left Dashboard Previous Tab
Shift-Up Dashboard Check script and move up? Not working or misunderstood
Shift-Down Dashboard Check script and move down? Not working or misunderstood
F1 Dashboard Help
Enter Editor (Search) Run Search
Ctrl-S Editor Save script
Escape Editor (Vim) Exit Insert Mode

Open the Tampermonkey menu from keyboard shortcut

  • Go to chrome://extensions
  • Scroll down to the end, on the bottom right, click the link Keyboard Shortcuts
  • Choose a combination such as Alt-T to Activate it

Accelerators for menu commands

Use the third option to GM_registerMenuCommand for a single-char mnemonic. This character will be underlined and you can quickly select the action by pressing Alt. For example:

GM_registerMenuCommand("Relativize Fixed", relativizeFixed, 'R');

Now, if you open the Tampermonkey menu by clicking the button right of the URL bar or activating the extension from keyboard, you can press Alt-R to execute the Relativize Fixed action.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment