MozRepl lets you program Firefox and other Mozilla-based applications from the inside.