Listen Later

·

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:


  1. This should work on Linux and OS X, not Windows.
  2. Make sure lame and mplayer are in Firefox's PATH, ie /usr/bin or /usr/local/bin
  3. There's not much error checking, so if it goes wrong it probably won't tell you why.
  4. 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.
  5. 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.