-
Notifications
You must be signed in to change notification settings - Fork 0
Home
RufusHamade edited this page Sep 13, 2010
·
3 revisions
This extension allows open a CGI script residing on your computer. The script is executed and the result is displayed as if you had accessed the script via a remote web server.
It currently is pretty limited:
- It is very hacky. It is little more than a proof of concept.
- There is no mechanism in Mozilla for setting environment variables, so we execute the CGI script with a (bash) wrapper script that sets the environment as appropriate. This makes the extension platform specific – though it should be pretty trivial to create wrapper scripts for other platforms.
- As nsIProcess has no mechanisms for reading a subprocesses stdout, the script output is dumped into a temporary file. The temporary file name is probably a huge security issue. Hopefully nsIProcess2 will eliminate the need for this temporary file.
- I’ve only tested on Linux. It might run on OSX, and definitely doesn’t run on Windows. (I don’t have suitable machines to develop and test those versions.) But it should be relatively straightforward to extend this to run on those platforms.
- It probably only works on Firefox 3. I’ve tested against the version of Firefox shipped with Ubuntu Jaunty and with a nightly build.
- It currently doesn’t handle POST requests.
Next steps:
- Extend the extension to other platforms
- Start using nsIProcess2 when that becomes available.
- Extend nsIProcess/nsIProcess2 to allow one to set environment variables directly (Rather than using the current hack.)
- Implement more of the CGI interface, in particular implement POST requests.
Anyway, if you think you might find this useful, need help using it or want to extend it in any way, just drop me an email.
Installing: read the readme.txt for instructions on how to package the code into an XPI file and/or tweak firefox to run the extension directly from its source directory. Feel free to contact me if you are interested in using this extension – especially if you want to run it on Windows or OSX – and I’ll give you a hand setting things up.