bugzilla.mozilla.org will be intermittently unavailable on Saturday, March 24th, from 16:00 until 20:00 UTC.

Support overriding existing keybinding through WebExtensions

REOPENED
Unassigned

Status

()

Toolkit
WebExtensions: Frontend
P5
normal
REOPENED
a year ago
8 days ago

People

(Reporter: Hi-Angel, Unassigned)

Tracking

(Blocks: 2 bugs)

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: triaged)

(Reporter)

Description

a year ago
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:50.0) Gecko/20100101 Firefox/50.0
Build ID: 20161115075801

Steps to reproduce:

Quoting the "webextensions" page of Mozilla https://developer.mozilla.org/en-US/Add-ons/WebExtensions/manifest.json/commands: 

> If a key combination is already used by the browser (for example,
> "Ctrl+Shift+R"), or by an existing add-on, then you can't override it. You will
> be allowed to define it, but your event handler will not be called when the
> user enters it.

There are addons which going to be awfully broken because of this upon rewriting from XUL to WebExtensions. To name a few: pentadactyl, vimperator. E.g. Ctrl+p and Ctrl+n swtches tabs with them. And mandating for a user to manually disable every browser's key before enabling the addon, and afterwards — in case a user decided to disable addon for awhile — re-enabling them one-by-one back, is a horrifying experience.

One possible solution to the problem, is to make a dialog, listing installed addons and the browser, and allowing to move up/down the order of preferred keybindings.

There might be other solutions as well, but it have to be solved before removing XUL.
(Reporter)

Updated

a year ago
Blocks: 1320336

Updated

a year ago
Blocks: 1215059

Updated

a year ago
No longer blocks: 1320336

Comment 1

a year ago
My usecase: in my UsableHomeButton extension [1], the Alt+Home keyboard shortcut (normally opens the browser’s start page) is overridden to perform the same action as pressing my modified version of the “Home” button of Firefox.

Additionally, Shift+(Alt+Home) in the extension acts as pressing the “Home” button while holding the Shift key (opens in new browser window), and Ctrl+(Alt+Home) acts as pressing the “Home” button while holding the Ctrl key (opens in new tab).

[1] https://addons.mozilla.org/firefox/addon/usablehomebutton/

Updated

a year ago
Status: UNCONFIRMED → RESOLVED
Last Resolved: a year ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1287093

Comment 3

a year ago
(In reply to Andy McKay [:andym] from comment #2)
Andy, I believe those bugs are about different things. IIUC, the bug 1287093 is about adding a _user_ interface for configuring keyboard shortcuts, while the current bug is about adding a possibility to override keyboard shortcuts (without any participation of user) via WebExtensions API like that's _already_ possible via XUL/XPCOM. So the current bug is not about adding something new, bug about just providing a feature equivalent to one we already have.
Ok I see, thanks for the clarification.
Status: RESOLVED → REOPENED
Ever confirmed: true
Resolution: DUPLICATE → ---

Updated

a year ago
Component: WebExtensions: General → WebExtensions: Frontend
Priority: -- → P5
Whiteboard: triaged

Updated

a year ago
See Also: → bug 1303384

Updated

a year ago
Blocks: 1325692

Comment 6

6 months ago
This came up here as well: https://github.com/lusakasa/saka-key/issues/53

Comment 7

4 months ago
This is pretty important from UX point of view. There is currently no addon to add or edit shortcuts for FF 57, but it should be treated as top priority to have this functionality by default in FF.

Comment 8

4 months ago
Hi,

Some OS or some keyboard layout collide with firefox 57 firefox-quantum keyboard shortcut.
Users was disabling some conflicting keyboard shortcut, for daily usage. 

It is very important do allow user to modify or disable any keyboard shortcut.

Question is on lot of websites:

* How to remove keyboard shortcut in firefox57? -> https://support.mozilla.org/en-US/questions/1188157
* https://superuser.com/questions/1272551/disable-single-shortcut-in-firefox-quantum/1273827#1273827
* https://www.reddit.com/r/firefox/comments/77gm9u/changing_default_keyboard_shortcuts_in_firefox_57/

etc.

Please add some documentation where to edit or disable shortcut.

My killing shortcut is CTRL-SHIFT-C, poping Inspector, as I just want to Copy, but my terminal is copying with this shortcut. I'm always raging against firefox opening the Inspector. I was disabling this shortcut before, how do I do?

Sylvain.

Comment 9

4 months ago
(In reply to Sylvain Viart from comment #8)
> My killing shortcut is CTRL-SHIFT-C, poping Inspector, as I just want to
> Copy, but my terminal is copying with this shortcut. I'm always raging
> against firefox opening the Inspector. I was disabling this shortcut before,
> how do I do?

I didn't want to mention it since it was just one data point, but I actually have the same problem.

While I'm doing development work or anything that involves heavy interaction with the terminal, I often find myself accidentally opening up the inspector) and then resenting the wasted time to switch to the mouse to dismiss it).

Comment 10

4 months ago
I signed up only to say that I'd really appreciate a shortcuts editor integrated into the vanilla Firefox quantum.
My problems are with ctrl+q (I'd like to move it to my system -XFCE- default quit shortcut, which is ctrl+shift+q) and ctrl+p, because they are too close to ctrl+w (close tab) and ctrl+[ (go back one page), respectively.

(In reply to Stephan Sokolow from comment #9)
> While I'm doing development work or anything that involves heavy interaction
> with the terminal, I often find myself accidentally opening up the
> inspector) and then resenting the wasted time to switch to the mouse to
> dismiss it).

I also have this problem Stephan, and I'm able to close the dev panel using the keyboard, with either ctrl+i or F12.

Comment 11

4 months ago
(In reply to Alberto Chiusole from comment #10)
> I also have this problem Stephan, and I'm able to close the dev panel using
> the keyboard, with either ctrl+i or F12.

I don't want this to go off-topic any further, so please don't reply to this, but neither of those applied for the following reasons:

F12 keypresses never reach Firefox because they're the default global hotkey for "toggle terminal" in Yakuake and I chose to preserve my muscle memory when I switched to urxvt's kuake plugin as a more lightweight alternative.

I don't know how you changed it on your system, but Ctrl+i is bound to the Page Info dialog on mine and, even if it weren't, there's no way I could have known that because Firefox hasn't rendered its menus with keyboard-shortcut hints in years (one of the original core motivations of menus as a UI element was to make keyboard shortcuts discoverable) and there's no keyboard remapping UI to serve double duty as a keybinding quick-reference sheet.

Comment 12

2 months ago
The lack of this API is quite bad for those of us used to traditional UNIX shortcuts, like Ctrl-W to delete the word before the cursor.  Ctrl-W closes the current tab in Firefox 57, so I am continually closing the tab while filling in web forms.  It would be great to have an API to disable Ctrl-W so this stopped happening.
You need to log in before you can comment on or make changes to this bug.