thePaulV / Most-Recent-Tab

Firefox addon that adds a keyboard shortcut to switch back to your most recently selected tab. Useful to alternate between two tabs and to easily go back to your last tab if you switch to another briefly.
https://addons.mozilla.org/en-US/firefox/addon/most-recent-tab/
Mozilla Public License 2.0
12 stars 4 forks source link

[macOS] Capture the Alt+Q sequence inside text fields and the URL #12

Closed mikhail-zolikoff closed 2 years ago

mikhail-zolikoff commented 3 years ago

Description

Simpler two-key sequences (like Alt+Q) are not captured when a cursor is inside of a text box or URL field.

Steps to Reproduce

  1. Set your keyboard shortcut to something like Alt+Q
  2. Move to a tab where your cursor isn't inside of a text field
  3. Move to another tab and place your cursor inside of a text field
  4. Attempt the key sequence. On a Mac, this extension won't fire and you'll instead see this symbol: œ

Expected behavior: The extension works and tabs are switched

Actual behavior: This symbol is shown: œ

Other Information and Versions

thePaulV commented 2 years ago

Confirmed in Firefox 94.0.2 on MacOS 12.0.1.

Looks like by design Firefox doesn't trigger addon shortcuts when there's focus on web content. See e.g. this comment https://bugzilla.mozilla.org/show_bug.cgi?id=1624738#c1

A workaround would be to add a content script to every page but I'd rather not get into that. Will revisit if implemented. I've opened a bug with Firefox (https://bugzilla.mozilla.org/show_bug.cgi?id=1743946) to track any upstream changes.

thePaulV commented 2 years ago

Looks like this is because MacOS hijacks alt-q before Firefox has a chance to do anything. See https://bugzilla.mozilla.org/show_bug.cgi?id=1743946 for more information. I've opened https://bugzilla.mozilla.org/show_bug.cgi?id=1745615 to see if they can add a warning when you set the shortcut that it might not work as intended.