Don't throw an error when calling _execute_browser_action when its been removed from browser UI

NEW
Unassigned

Status

()

Toolkit
WebExtensions: General
P5
normal
2 months ago
2 months ago

People

(Reporter: markh, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [triaged][commands])

(Reporter)

Description

2 months ago
STR:
* Install an addon that supports a hotkey to invoke its functionality - eg, manifest.json including something like:

    "_execute_browser_action": {
      "suggested_key": {
        "default": "Ctrl+Shift+Y"
      }

* Verify the hotkey works.

* Enter Firefox "customize" mode and drag the addon's icon to the "Additional Tools and Features" area, effectively removing the icon from any browser UI.

* Attempt to use the hotkey.

Expected:
* It works.

Actual:
* It doesn't, and the console logs:

JavaScript error: resource:///modules/CustomizableUI.jsm, line 1491: TypeError: this.getPlacementOfWidget(...) is null

Via https://github.com/bitwarden/browser/issues/112#issuecomment-289634214

Updated

2 months ago
Flags: needinfo?(amckay)

Comment 1

2 months ago
This is by design, if the browser action has been removed from the browsers UI, then we don't execute it when the command is called. We probably shouldn't show that error though.
Flags: needinfo?(amckay)
Priority: -- → P5
Summary: suggested_key for commands fail to work when addon icon is removed. → Don't throw an error when calling _execute_browser_action when its been removed from browser UI
Whiteboard: [triaged][commands]
(Reporter)

Comment 2

2 months ago
FTR, when extensions are added to Chrome, the equivalent for removing it from the toolbar is "Hide in Chrome Menu". These hotkeys still work when the extension has been hidden in that way.
You need to log in before you can comment on or make changes to this bug.