views:

56

answers:

1

Hi,

I am creating a Firefox extension which will be using the Last.fm API. Now I want the extension to be able to determine which song the user is currently listening in WMP or iTunes. Does someone know how I can do this?

useful edit: I only need the song name, album name and artist

Thanks

A: 

I was about to suggest you look into FoxyTunes source, but turns out it's proprietary now.

Since there's no built-in API in Firefox to do that, you'll have to write the integration code yourself. That is, you should first understand what would you do in, say, C++ to get the information you need.

Then to integrate this in your extension, your main option is wrapping your C++ code in an XPCOM component, which allows you to call into it from extension's JS.

Recent Firefox versions also have ctypes support, which gives you a way to call into binary libraries directly from JS.

Nickolay