Here's another alpha-release Firefox extension: Listen Later. This one adds an icon to Firefox's address bar when on a BBC iPlayer Radio page for an individual programme (ie when the RealPlayer buttons are visible) which, when clicked, will record that programme to an MP3 on your desktop.
There are several notes to observe:
- This should work on Linux and OS X, not Windows.
- Make sure lame and mplayer are in Firefox's PATH, ie /usr/bin or /usr/local/bin
- There's not much error checking, so if it goes wrong it probably won't tell you why.
- There's no sanitisation of parameters passed from the web page to the command line, so if some malicious code got into the BBC's HTML it could cause damage.
- Due to a bug in Firefox, there's no interface to stop the process once it's started recording. You can run killall mplayer in Terminal if necessary.
One other technical note: it's impossible within a Firefox extension to translate a chrome:// path to an absolute path, which would be necessary to use initWithPath() to run an executable file that's packaged within the extension. Hence the big hack that is the XPCOM component full of boilerplate code in the components folder (adapted from the one in Stylish), that copies the executable into the user profile directory, for which the extension can get the absolute path.