in reply to Call for perl from other applications

It really depends on the application and its environment, but since you're talking about firefox, it should be possible to provide some sort of extension that would automate the process. Have a look at greasemonkey if you want to experiment, and aren't afraid of messing with javascript and the (frankly quite ugly) mozilla XUL/internal JS bindings.