Here's something I did five years ago in IE-DHTML (Internet Explorer DHTML):
http://www.jondavis.net/javascriptConsole.htm
Doesn't seem to work in Firefox.
I had AJAXy plans back then to callback to a server and execute a few console commands. I never followed through with that. I should revise that plan and come up with something kewler, maybe something RESTful.