27
6
I'm using Firefox in version 39.0. My keyboard has Media Keys and I want to use them for controlling sites like Soundcloud, Youtube, etc.
Is that possible?
27
6
I'm using Firefox in version 39.0. My keyboard has Media Keys and I want to use them for controlling sites like Soundcloud, Youtube, etc.
Is that possible?
14
Yes it is possible! For this download Media Keys from addons.mozilla.org. This tool adds a media key event listener to Firefox and makes it possible to use:
on every supported music/video site.
For some reason the media keys are only working if Firefox is the active window (occured on Windows 10). Also add-on currently does not work with Firefox 57+.
18
The Media Keys add-on does not work in Firefox version 57, because the developers have decided to remake Firefox into a Chrome clone. For November 2017, they have announced their intention to drop in Firefox 57 their current add-on format, now called "Legacy", in favor of WebExtensions, which in plain English are very similar to Google Chrome extensions.
This will in theory open most of the Chrome Store to Firefox users, but will invalidate all, and I do mean all, current add-ons whose developers will not convert in time to WebExtensions.
One can already see the problem in Firefox 56 by opening the Add-ons tool. The add-ons that will not work in version 57 are marked by a yellow LEGACY notice :
I have 46 add-ons in Firefox with which I have created the environment that is just right for me. All of them, except only one, are marked as legacy. The problem is much more general and extensive than you think.
Some possible solutions are listed below :
Ask the developers of your add-ons to make the effort of converting to WebExtensions.
Firefox 57 will include a "find similar extension" tool which might help to find replacement add-ons.
Abandon Firefox in favor of Chrome (I'm sure that a large percentage of Firefox users will follow this route).
Turn off updates and stay with Firefox 56 forever - not a real solution. One can also use here Firefox Portable.
Switch to Firefox ESR which will continue in version 56 until June 26, 2018, in the hope that someone will come up until then with a solution for running legacy add-ons in Firefox 57. This is not really much different from the above solution, except that critical updates will not be blocked.
Switch to Pale Moon, or Waterfox, both forked from Firefox, although not all add-ons are compatible.
None of these solutions is perfect, but I don't know of a better one at the moment. I think that the Firefox developers made a very stupid decision which will cost them a hefty chunk of their already eroding market share, but they are not asking for anybody's advice.
Another solution would be to use Chrome extensions in Firefox 57. The add-on Chrome Store Foxified already allows this.
From the article How many Chrome extensions will run in Firefox :
Mozilla's Andy McKay decided to find out in November 2016. He parsed the Chrome store sitemap and got 100,000 extensions, apps and themes out of it which he analyzed to find out how many of them will run in Firefox.
According to his findings, about 76% of Chrome extensions of the sample size will run in Firefox. The remaining extensions either miss one or more APIs, one or more permissions, or one or more manifest.
I have found the Chrome extension Streamkeys which according to its author does everything you asked for. However, not having Firefox 57, I don't know if it will work in it.
References :
A very light-weight solution for all browsers and versions, makes use of the following observations:
Specifically for youtube, a list of the hotkeys can be found in the article 30+ YouTube Keyboard Shortcuts You Need to Know. Some of the ones corresponding to the keyboard media keys are:
Spacebar - Pause/Play video (player focus required)
K key - Pause/Play video (doesn’t require focus)
↑ (Arrow key up) - Turn up volume 5%
↓ (Arrow key down) - Turn down volume 5%
Ctrl+→ - Move to next video (only in playlist)
Ctrl+← - Move to previous video (only in playlist)
These keyboard's media keys can be mapped to these keys using AutoHotkey. A list of AutoHotkey key-names is found in the article List of Keys, Mouse Buttons, and Joystick Controls.
An example of a AutoHotkey script for Youtube is:
SetTitleMatchMode, 2 ; match anywhere in window's title
#ifWinActive YouTube ; only if window title contains YouTube
Media_Next:: Send ^{Right} ; Next Track - ctrl+right-arrow
Media_Prev:: Send ^{Left} ; Previous Track - ctrl+left-arrow
Media_Play_Pause:: ; Stop/Start - Spacebar
Media_Stop:: Send {Space}
The above script is completely untested, as my keyboard does not have these keys.
4
Currently the Firefox commands API does not support media keys nor global keys.
Until these issues are fixed by Mozilla, you can use Chromium with the Streamkeys extension.
@Steven Penny. Thanks for edit. I really appreciate your time and effort to research on the subject.! – xavier_fakerat – 2017-12-10T13:16:47.563
1At least I'm not the only one unhappy with FF. Good answer, UVed. As for what I've done. I'm still on vista, so I was stuck with 51 ESR, now that looks like a good thing. – David – 2017-10-19T13:39:43.933
@David: Myself I'm now on Firefox ESR 52.4.1, equivalent to FF56 and with the security updates from FF57. This gives me 8 more months to find a permanent solution. – harrymc – 2017-10-19T14:36:47.617
I have found that FF ESR has problems with some addons which are unable to save their settings, example LastPass. Also the ESR version while based on FF56 is strangely named version 52, but because of this some addons refuse to work saying that the required Firefox version is at least 55. For these reasons I have moved to Waterfox, with which I'm very pleased. – harrymc – 2017-11-04T16:12:53.897
Thanks, I apdated the AutoJotkey script to linux using xdotools – gwenzek – 2017-11-17T10:49:35.653
2Don't blame this on the extension developers. The API in FF57 (And Chrome) is severely crippled due to ridiculous omissions/shortcomings/crippling by Google (and now Mozilla). Decent: password managers, session managers, context menu managers, and download managers are now impossible. The Chrome equivalents are pale, user-hostile mockeries of what was once available on FF. – Brock Adams – 2018-01-01T17:38:47.243
For Waterfox users, Classic Add-ons Archive has a copy of Media Keys 1.0.3 that works.
– endolith – 2020-01-24T01:09:24.443