Commands API allows assignment to pre-existing function key shortcuts
Categories
(WebExtensions :: General, defect)
Tracking
(firefox80 affected, firefox81 affected, firefox82 affected)
People
(Reporter: u482975, Unassigned)
Details
Attachments
(1 file)
|
765 bytes,
application/x-zip-compressed
|
Details |
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:81.0) Gecko/20100101 Firefox/81.0
Steps to reproduce:
- Define a command in the
manifest.jsonassigned toF5, a function key which is already mapped to the "Refresh Page" by the browser. - Handle the
onCommandevent in yourbackground scriptso you can tell when the command is being triggered. - Press F5 in any tab.
Actual results:
The page refreshes and the command is triggered.
Expected results:
I would expect either/or to happen, not both simultaneously.
And as per the documentation, the command should not be triggered:
If a key combination is already used by the browser (like "Ctrl+P") or by an existing add-on, then you can't override it. You can define it, but your event handler will not be called when the user presses the key combination.
I've attached an example WebExtensions, which will log a message to the console when the F5 command is triggered.
Comment 1•5 years ago
|
||
Hello,
I’ve managed to reproduce the issue based on the provided STR and the attached extension on the latest Nightly (82.0a1/20200906215057), Beta (81.0b7/20200906164749) and Release (80.0.1/20200831163820) under Windows 10 Pro 64-bit and Ubuntu 16.04 LTS.
Pressing F5 will refresh the page as expected but also the command is triggered simultaneously (a message is logged in the console).
I’ve also attempted to search for a regression window spanning from 2018-01-01 until the present day. All tested builds in the mentioned time frame are affected by the issue, thus, this might not be a regression, but how it always has been.
Comment 2•5 years ago
|
||
The built-in shortcut limit is currently only enforced when the user attempts to assign a new shortcut via about:addons.
The implementation does not have special support (or lack of support) for built-in shortcuts, and that's tracked in bug 1325692.
Description
•