Do you need to use selenium to control Firefox in headless mode or does it have something lower level like Chrome's devtools protocol?
2. Firefox's WebDriver endpoint geckodriver[1] is a layer above Firefox/Gecko's native Marionette protocol[2]
So you doubly don't need to use selenium, you can write your own WebDriver client (which should be cross-browser assuming the browsers either support WebDriver natively or have a WD layer of some sort installed) or you can use raw Marionette (either a hand-rolled client or an existing client)
[0] https://w3c.github.io/webdriver/webdriver-spec.html#protocol
[1] https://github.com/mozilla/geckodriver
[2] https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionet...