![]() |
|
|
Scripting support for an application that is used frequently is an absolute necessity. Mozilla is an application that I use frequently. In fact, about the only things I use more frequently than Mozilla are pine and emacs. And I spend an awful lot of time wishing that pine supported better scripting. Again, I remind you that when I'm talking about scripting, I don't mean things that someone would embed in a web page, but external scripts that the user would specifically obtain and install (even though that installation might be an absurdly simple process). The idea here is that while Mozilla does a whole bunch of stuff, it doesn't necessarily do quite what you want or do so quite the way you'd like it. Since people working on the Mozilla code base itself are few in number, they have neither the resources nor the inclination to anticipate exactly what everyone wants. Instead, they can develop an interface to a scripting language that allows low level control of just about everything useful that Mozilla can do. Then the much larger set of people who happen to know how to program but don't have the time or resources to work directly on the Mozilla code base can write scripts that do what they want and how they want it. The hope is then that with this wider set of people implementing features, a simple feature desired by a non-programmer is more likely to get done as a scripted extension than as a feature added directly to the Mozilla code base. Let me illustrate some situations where one might make use of scripting support for those of you who don't find yourselves brimming over with ideas already.
The next order of business is to describe some ideas on how to accomplish all of this. Let me start by describing my grand vision of how scriptability would be implemented in Mozilla. The engineers at Netscape are working on modularizing the code base and have taken the initiative to architect a framework for doing just that. This framework provides for the definition of interfaces to objects that comprise a running instance of the browser. Consider writing a tool that automates the generation of hook functions that allows calling of those interface functions on your scripting language's idea of objects. Bingo, everything you wanted to do and more just became possible. You would then have to establish some mechanism for addressing (getting a handle on) important objects from within a script, so there's a little work to do. Then good scripting support is simply a matter of well thought out modularization. Can you say "two birds with one stone"? I thought you could. With the hard part out of the way, you would then want to make these scripts easily callable in Mozilla by allowing the user to bind scripts to some sort of script menu (with hot keys) or drag them right onto whichever toolbar happens to be visible while they are performing the task that they want to script. This would provide an easy mechanism for people to distribute (and for other people to install) these scripts. Imagine downloading a script into file and dragging it right onto the browser's toolbar and all of a sudden having the "edit source in place" functionality that I described above. How cool would that be? Some links to get you started:
|
|||||||||||
| Copyright © 1998 The Mozilla Organization. | ||||||||||||