Closed Bug 1662998 Opened 4 years ago Closed 4 years ago

Commands API allows assignment to pre-existing function key shortcuts

Categories

(WebExtensions :: General, defect)

Firefox 81
defect

Tracking

(firefox80 affected, firefox81 affected, firefox82 affected)

RESOLVED DUPLICATE of bug 1325692
Tracking Status
firefox80 --- affected
firefox81 --- affected
firefox82 --- affected

People

(Reporter: u482975, Unassigned)

Details

Attachments

(1 file)

765 bytes, application/x-zip-compressed
Details
Attached file fkey-command-test.zip

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.json assigned to F5, a function key which is already mapped to the "Refresh Page" by the browser.
  • Handle the onCommand event in your background script so 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.

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.

Status: UNCONFIRMED → NEW
Has STR: --- → yes
Ever confirmed: true

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.

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: