WebDriver is cool, but I want to be able to create my own commands which will be run in the browser. So I did. It was not straight forward to do so; I suspect this is case of negligence on the part of WD developers - cuz wanting to do this has to be super common. Created with WebDriver 2.41.0, updated to use 2.45.0.
#This is a copy from a production project. This copy is NOT tested at all. The code is good but I may have forgotten to dot an "I" or cross a "T" somewhere.
This code has two sides, the JS FF Addon side, and the Java WebDriver side. One side does nothing without the other. Up to you to get "my_ff_addon" content into FF.