Created attachment 8816746 [details] [diff] [review] patch.txt User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0 Build ID: 20161025170400 Steps to reproduce: In order to convert SDK addons to the new WebExtension technology, we have to support Function Keys (F1, F2, etc. F12) on keyboards. The attached patch adds the support of such keys in the "commands" section of a WebExtension. This patch is quite simple, because the code in browser/components/extensions/ext-commands.js does not even needs to be changed. We only need to change the regular expression, to allow these function keys. Attached, there is also a test WebExtension (manifest.json/background.js) to show the usage of several key combinations. Please include this patch in Firefox sources, so it will allow us to convert SDK addons to WebExtension. Thank you.
Comment on attachment 8816746 [details] [diff] [review] patch.txt Review of attachment 8816746 [details] [diff] [review]: ----------------------------------------------------------------- Sorry for the delay. We've all been traveling for a company-wide all hands, which makes things a bit hectic. This looks good. Thanks! Please add the checkin-needed keyword when you're ready for it to land. https://treeherder.mozilla.org/#/jobs?repo=try&revision=13eb84d41ca88653101a1205cac5dc5d330af21b
Pushed by email@example.com: https://hg.mozilla.org/integration/autoland/rev/781d1e9b8586 Support Function Keys in WebExtensions. r=kmag
I had to back this out for bustage like https://treeherder.mozilla.org/logviewer.html#?job_id=8132421&repo=autoland https://hg.mozilla.org/integration/autoland/rev/cd1610b7d0c474b53a63b6db8f434b9320eeed52
Hello, A fixed patch is attached as patch2.txt. My testing web extension was working, but not the automated test suite. I guess I ran the automatic tests manually on the unpatched tree, so the tests were not really tested. Now, I used on the patched tree : ./mach test browser/components/extensions/test/xpcshell/test_ext_manifest_commands.js ./mach test browser/components/extensions/test/browser/browser_ext_commands_onCommand.js And this is apparently the good way to run tests. Correct me if this is wrong. Sorry for my mistake.
Created attachment 8822908 [details] [diff] [review] patch2.txt The fixed patch, with working test case.
Thanks Laurent, if that patch is good to go, can you add "checkin-needed" to the keywords, then the sheriffs will try and autoland the patch for you.
I've added the "checkin-needed" keyword.
Pushed by firstname.lastname@example.org: https://hg.mozilla.org/integration/mozilla-inbound/rev/e12ce3afaf80 "Patch to support Function Keys in WebExtensions". r=kmag
Thanks so much, Laurent! Your contribution has been added to our recognition wiki at https://wiki.mozilla.org/Add-ons/Contribute/Recognition#January_2017. Welcome onboard! We're happy to have you on the team.
I was able to reproduce the initial issue on Firefox 53.0a1 (2016-12-04) under Windows 10 64-bit. Verified fixed on Firefox 53.0a1 (2017-01-09) under Windows 10 64-bit and Ubuntu 16.04 32-bit. The webextension is successfully installed and the following error is no longer thrown in Browser Console: http://pastebin.com/jRBJTLbk