Home | Download | Getting Started | Contact | White Paper | Examples | Documentation | Troubleshooting | Newsgroup | Mailing List | Source Code | Bugs | Screenshots

Protozilla Examples

(Note: Many of the non-standard hyperlinks on this page are for illustration only. They will work only if you are using Mozilla with Protozilla installed! To try out these protocols, first initialize Protozilla using the Tasks menu of the browser.)

During Protozilla installation, a directory (or folder) named protozilla is created in the user's current profile. Within this directory, two sub-directories named protocol and cgi+ are also created.

The Protozilla configuration window may be loaded from the Tasks menu, or from the command line using the -protozilla option, which are the preferred ways to load it. There are two predefined protocols in Protozilla: protozilla and cgi+. For example, the URI protozilla: will load the Protozilla configuration window. A Protozilla session begins when you first load an URI using any of the protocols registered by Protozilla.

A protocol handler is usually just an executable file in the protocol directory. Defining a new protocol is as simple as creating a file in this directory. You can drag-and-drop the file from the desk to the Protozilla configuration window, or create it in site using the Create option. The protocol name is the filename (excluding any extension). Protocol names consist of a sequence of characters beginning with a lower case letter and followed by any combination of lower case letters, digits, plus ("+"), period ("."), or hyphen ("-") (RFC2396). Protocol names ending in "+" are treated specially by Protozilla, as discussed later.

Protozilla automatically registers all protocols when the Protozilla configuration window is loaded. For example, if the Perl script is present in the protocol directory, then the protocol foo: is automatically registered. When an URI using this protocol needs to be loaded, Protozilla executes the script, much like a CGI program, and displays the output from the script. The script may output MIME headers to identify the content type as being HTML, XML, XUL etc. If MIME headers are not found, Protozilla attempts to guess the content type from the filename portion of the URL, failing which Protozilla tries to display the output as plain text. (In addition to handling the usual suspects for scripting languages, such as Perl or Python, Protozilla can also execute scripts written in Javascript! Try jsproto:.

Though the protocol handler is usually an executable CGI program, there two special cases:

Protocol names ending in "+" are treated as restricted protocols by Protozilla. URIs using these protocols may only be loaded from scripts with system privileges. They may not be loaded simply by clicking HTML hyperlinks or from unprivileged scripts. An example is the predefined cgi+ protocol described below. (The protocol index page URI, e.g. foo+:, is not subject to these restrictions.)

Files in the cgi+ directory are treated as CGI programs. For example, typing the URL cgi+:/ in the URL box executes the Perl script in the CGI directory. The query portion of the URL may be used to transmit information to the CGI script, e.g., cgi+:/¶m2=value2 In addition to the environment variables required by the standard CGI specification, Protozilla defines some additional environment variables. Click cgi+:/ for a list. (At present, the POST method is not implemented in the CGI+ protocol.)

You may simply drag-and-drop a CGI program from the desktop into the CGI+ index page, or use the Copy button in the index page to copy the program to the CGI directory. Error messages (stderr) from the CGI script will appear in the Protozilla console.

The protozilla project can be contacted through the mailing list or the member list.
Copyright © 2000-2020. All rights reserved. Terms of Use & Privacy Policy.