Your Location is: Home > Linux

Creating a headless Firefox, interacting with it via an addon, and communicating results to a process

From: Mongolia View: 1673 Thor Correia 

Question

Motivation:

I'm a big fan of spotify-tui. The issue is: I'm actually an Apple Music user. I'd like to fork spotify-tui and create an Apple Music version, primarily for use on Linux systems. Apple does offer a Web API, however it requires a developer license which would not allow me to create a free, open source project.

Theory:

My idea is to actually use Apple's own webplayer. I would run this web player in a headless Firefox daemon and create a Firefox addon that would interact with the page and intercept the AJAX request responses. It would then communicate this data to the TUI process for rendering. User input into the TUI would be communicated to the addon which would make the appropriate requests.

Question:

I have never experimented with Firefox addons, so I only need some general pointers to the relevant documentation / classes / search terms I should be looking at.

  1. Most importantly, is this even possible?

If so, what documentation should I be looking at for:

  1. Creating a Firefox daemon?

  2. Having the addon intercept the network responses?

  3. Having the addon follow URLs?

  4. Having the addon communicate with an external process?

Thanks,

Best answer