Creating a headless Firefox, interacting with it via an addon, and communicating results to a process
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.
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.
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.
- Most importantly, is this even possible?
If so, what documentation should I be looking at for:
Creating a Firefox daemon?
Having the addon intercept the network responses?
Having the addon follow URLs?
Having the addon communicate with an external process?