Maybe there's a simpler way to send commands directly to firefox. It acts something like a dcop server. Googling outthere I've found bash strings like:
Code:
firefox -remote 'ping()'
or
Code:
firefox -remote 'openURL(www.google.com, new-window)'
If anyone knows how that works, maybe it's possible to use such a syntax in order to control the browser internal functions... Unluckyly I didn't find nothing but those examples above!