[tracking] Commands API support for WebExtensions

NEW
Unassigned

Status

()

Toolkit
WebExtensions: General
P3
normal
a year ago
4 months ago

People

(Reporter: Thomas Henlich, Unassigned)

Tracking

(Depends on: 2 bugs, Blocks: 1 bug, {dev-doc-complete})

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [commands]triaged[tracking])

(Reporter)

Description

a year ago
User Agent: Mozilla/5.0 (Windows NT 6.1; rv:43.0) Gecko/20100101 Firefox/43.0
Build ID: 20160105164030

Steps to reproduce:

Tried to implement an extension that uses hotkeys to run commands.


Actual results:

Found out that the commands API is not supported.


Expected results:

The commands API should be supported, eventually.
(Reporter)

Updated

a year ago
Severity: normal → enhancement

Updated

a year ago
Blocks: 1161828
Severity: enhancement → normal
Status: UNCONFIRMED → NEW
Ever confirmed: true
Whiteboard: [commands]

Updated

a year ago
Priority: -- → P2
Whiteboard: [commands] → [commands]triaged

Updated

a year ago
Depends on: 1242557

Updated

a year ago
Whiteboard: [commands]triaged → [commands]triaged[tracking]
Depends on: 1246024
Depends on: 1246028
Depends on: 1246029
Depends on: 1246031
Depends on: 1246032
Depends on: 1246034
Depends on: 1246035
Depends on: 1246038
Depends on: 1246042
Assignee: nobody → mwein
Iteration: --- → 47.2 - Feb 22
Iteration: 47.2 - Feb 22 → ---
Depends on: 1251795
Iteration: --- → 48.1 - Mar 21

Updated

a year ago
Keywords: dev-doc-needed
Iteration: 48.1 - Mar 21 → ---
Summary: commands API not supported → [tracking] Commands API support for WebExtensions
Any chance we could get this documentation added to MDN for Firefox 48 Will?
Flags: needinfo?(wbamberg)
Some docs:
manifest key: https://developer.mozilla.org/en-US/Add-ons/WebExtensions/manifest.json/commands
JS API: https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/commands

I've also added the compat data, so it shows up in pages like https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Browser_support_for_JavaScript_APIs#commands.

Please let me know if you think this covers it.

A few things came up, most of which I have filed bugs for. But a couple of things I didn't because I wasn't sure they are bugs:

* Chrome does not allow "Command" as a modifier, but we do. Is that intentional?

* I couldn't get any shortcuts of the form <modifier>+Shift+<number> to work at all (I can register them, but onCommand isn't triggered). Maybe they are all just taken by the browser?
Flags: needinfo?(wbamberg) → needinfo?(amckay)
Flags: needinfo?(mwein)
(In reply to Will Bamberg [:wbamberg] from comment #2)
> * Chrome does not allow "Command" as a modifier, but we do. Is that
> intentional?

Interesting. I think we read "on Mac 'Ctrl' is automatically converted to
'Command'" as suggesting that "Command" was valid on OS-X. I'm not sure if we
should change that.

> * I couldn't get any shortcuts of the form <modifier>+Shift+<number> to work
> at all (I can register them, but onCommand isn't triggered). Maybe they are
> all just taken by the browser?

That's interesting... We definitely have tests for that. But it looks like we
only have tests for Alt+Shift modifiers. We should probably test other
combinations as well.

Can you file a bug?
Thanks Will, looks good.
Flags: needinfo?(amckay)
(In reply to Kris Maglione [:kmag] from comment #3)
> (In reply to Will Bamberg [:wbamberg] from comment #2)
> > * Chrome does not allow "Command" as a modifier, but we do. Is that
> > intentional?
> 
> Interesting. I think we read "on Mac 'Ctrl' is automatically converted to
> 'Command'" as suggesting that "Command" was valid on OS-X. I'm not sure if we
> should change that.
> 
> > * I couldn't get any shortcuts of the form <modifier>+Shift+<number> to work
> > at all (I can register them, but onCommand isn't triggered). Maybe they are
> > all just taken by the browser?
> 
> That's interesting... We definitely have tests for that. But it looks like we
> only have tests for Alt+Shift modifiers. We should probably test other
> combinations as well.
> 
> Can you file a bug?

-> bug 1272198.
The docs look good, thanks! One thing that I think we should make note of is the fact that the Media Keys currently aren't supported.  The bug to track support for this is bug 1251795.

Also, thanks for filing bug 1272198. I initially thought certain modifiers weren't working because they were already reserved, but the amount that don't work seems excessive.  I'll see if I can figure out what's going on and then add some unit tests to cover the other combinations.
Flags: needinfo?(mwein)
(In reply to Matthew Wein [:mattw] from comment #6)
> The docs look good, thanks! One thing that I think we should make note of is
> the fact that the Media Keys currently aren't supported.  The bug to track
> support for this is bug 1251795.

Oh, good call. I have added this.
Keywords: dev-doc-needed → dev-doc-complete
Duplicate of this bug: 1260503

Updated

9 months ago
Depends on: 1295276

Updated

8 months ago
Depends on: 1303384

Updated

8 months ago
Assignee: mwein → nobody

Updated

8 months ago
Component: WebExtensions: Untriaged → WebExtensions: General

Comment 9

4 months ago
I am a bit unsure what the status of this bug is. It seems like there is some support, but I just tried porting my add-on that uses Ctrl-Space and Ctrl-Shift-Space and those don't. Numbers don't seem to work either and they should. If I replace Space by something else without changing the rest of the code it does work. However, If I use a letter that is already used, it won't work either. But it's not possible to know beforehand whether something will cause a conflict with existing shortcuts? Also, there is no way to edit shortcuts like there is in Chrome. There really should how else will it be possible to detect/fix conflicts? Tested with Nightly 53.0a1

Updated

4 months ago
No longer depends on: 1303384

Comment 10

4 months ago
This is a tracking bug to track all the bugs around getting to chrome parity for the commands API. Discreet features or bugs are tracked on individual bugs. Please add in bugs for those issues so people can pick them up.

Comment 11

4 months ago
Dropping priority of the tracker to match the dependencies.
Priority: P2 → P3
You need to log in before you can comment on or make changes to this bug.