-
Notifications
You must be signed in to change notification settings - Fork 81
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
Add a pane in the dashboard (Firefox only) to assign keyboard shortcuts #106
Comments
They were removed by gorhill after an issue was raised, see - gorhill/uBlock#2723 (comment) |
This is an issue with Firefox itself — there is no UI for reassigning webextension shortcuts: https://bugzilla.mozilla.org/show_bug.cgi?id=1303384 uBlock Origin provides several "commands" (including entering element picker and element zapper mode) for which shortcuts could be assigned, but does not set any pre-defined shortcuts for them (AFAIK because these occasionally collided with various other, sometimes system, shortcuts and people complained...). Unfortunately this means that without support from the browser (i.e. Firefox) for changing/assigning shortcuts, you can't actually use them. On Chrom(e|ium) shortcuts can be easily set, by going to Bug on the old tracker: gorhill/uBlock#2870 There is, however, now an option for a webextension to reassign its own shortcuts (https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/commands/update). Potentially, uBlock Origin could work around the Firefox bug by providing a UI for reassigning its own shortcuts. Would a patch providing such support be considered (or is it out-of-scope for uBlock Origin)? |
Duplicate of gorhill/uBlock#3473 |
For whatever it's worth, the latest release of the Flagfox 6.1.0 just re-implemented user-customizable keyboard shortcuts.
|
If those keys are already in use, it will not work. |
Ctrl+Shift+X and Ctrl+Shift+Z doesn't work on my end either, Ctrl+Shift+L works though. |
Yes, exactly. |
That's why Chromium's approach is nice, all shortcut assignments are centralized -- I really thought this was going to be addressed by Firefox as a priority. Anyways, there are still things to address in the issue here:
|
So why doesn't Ctrl+Shift+Z work? It's not in use unlike Ctrl+P |
I don't know. Firefox probably returns an error when trying to assign it, I need to add code to catch that error. Edit: "Ctrl-Shift-Z" works on my side (Linux/Nightly). |
For the sake of argument, Ctrl+Shift+X doesn't work on my end also fyi |
Aaaaaaand it stopped working. I can see the shortcut is properly set because uBO will query directly the |
Actually, Ctrl-Shift-Z is usually assigned to the Redo operation, so I suspect the key strokes are caught somewhere and never make it to uBO. |
Issue is not uBO, Firefox never calls uBO with a lot of Ctrl-... shortcuts apparently. Maybe I should just forbid using Ctrl, because these are apparently ok to use, but they don't work as far as I can tell. |
I am going to have to reject "Ctrl" shortcuts, Firefox does not return an error when a shortcut is not going to be actually triggered for an extension. I looked at Flagfox and it also does not allow Ctrl-based shortcuts. |
Using the browser toolbox, I can see Firefox is already defining a command for ctrl-shift-z => "redo": For instance, I couldn't spot one for ctrl-shift-u in Firefox-defined commands, and as expected it worked with uBO. Maybe it could be argued that there is something to fix on Firefox's side, i.e. that the |
In the case of the Shift-Alt-{letter} combinations, they seem to be recognised correctly if you press the keys in the order The lack of support for function keys beyond F12, is a Firefox (not uBlockOrigin) limitation: https://developer.mozilla.org/en-US/Add-ons/WebExtensions/manifest.json/commands#Shortcut_values (Edit: Other than that, and the collision with in-built shortcuts, which is beyond uBlock's control, everything works great in 1.16.15b2.) |
Yes, pressing Alt/Ctrl and then Shift does work when setting the shortcut, but you must also then press the keys in that sequence to execute the shortcut as well. This does not work if you want to use a Ctrl-Alt or Alt-Ctrl combination. Alt and Ctrl seem to be mutually exclusive. Also, the meta key doesn't appear to be available. This is all just user feedback, not an indication of a problem. |
These are all Firefox by-design behaviors, read the link posted above, we will have to live with these until they decide to centralize shrotcut assignement UI. I consider the issue fixed. Keep in mind uBO's primary purpose is not to have a full-fledged over-complicated shortcut assignment UI. I observed the behavior of what exists in Chromium, and try to do as closed as can be without spending undue amount of time on this feature (a workaround due to lack of UI shortcut assignment in Firefox) which I was not originally planning to provide. I will revised as needed when someone report back with information re. "Command key" above. |
There still is a minor issue with Azerty keyboards though, for example in the Shortcuts pane, trying to assign Alt-Z will enter Alt-W in the input & will react to Alt-W. |
This needs fixing, I will look into it. |
I activated the French keyboard layout here (AZERTY), and the shortcuts were properly read (Linux Mint). So I can't reproduce. |
@Betsy25 Can you tell me what is reported in this applet when you enter Alt-Z? |
Pressing Alt-Z on an Azerty keyboard gives me : |
Just to be sure... The physical key you pressed had "Z" on it? |
Yep, on an Azerty keyboard, the physical keys pressed were "Alt" and "Z". Physically pressing "Alt" and "A" gives me : Win7 x64, Firefox Stable + Firefox Nightly. |
I can confirm that the layout bug is fixed with the latest dev build. |
@gorhill It appears that if It seems that once the key binding is set by setting I looked over the bugzilla issues you posted in this thread and didn't see it brought up and I'm really not sure if this is a firefox bug or uBlock Origin bug so wanted to bring it to your attention. |
uBlock Origin has no knowledge of that flag, it merely just calls |
@gorhill Forgive me if I am being dense here, but I don't see that tab, did I miss a special consideration that would make it appear? |
@GuardianMajor What version of uBO do you have installed? (The current latest version on AMO is 1.16.14, while the added functionality is only in version 1.16.15(x), which you can download from GitHub.) (Also see above.) |
You need uBO 1.16.15b? and Firefox 60+, the API needed to dynamically assign shortcuts ( |
Asked above, but it might have been lost in the noise: Any chance of adding a shortcut to open the Dashboard as there is with the logger? |
The current keyboard shortcut pages not work for Apple Mac Keyboard layout.
I have a quick hack to make things work. Here maybe what you want @gorhill ? |
Prerequisites
Description
I would like to see keyboard shortcuts added to allow the element picker and element zapper operations to be launched without the two-step process of opening the menu and then selection the desired operation. This would be especially useful and a time saver when working on a page where you want to block a series of elements.
So far as I can tell, uBO isn't supporting keyboard shortcuts at the moment.
A specific URL where the issue occurs
Steps to Reproduce
Expected behavior:
Actual behavior:
[What actually happened]
Your environment
The text was updated successfully, but these errors were encountered: