Marionette

marionette | ˌmarɪəˈnɛt |

noun

Marionette is the remote protocol that lets out-of-process programs communicate with, instrument, and control Gecko-based browsers.

It provides interfaces for interacting with both the internal JavaScript runtime and UI elements of Gecko-based browsers, such as Firefox and Fennec. It can control both the chrome- and content documents, giving a high level of control and ability to replicate, or emulate, user interaction.

Head on to the documentation to find out more.