firefox python plugin

Carl Banks invalidemail at aerojockey.com
Tue Mar 8 17:21:24 EST 2005


M.N.A.Smadi wrote:
> i want to write a script to do the following:
> when using firefox to download a textfile, instead of saving it to
the
> hard dist, i want to run a python script on it, and i want the python

> script then to prompt me for the location where i want to store the
> processed downloaded file

I can't help you with details, but here's some general tips:

First, although you say "plugin", I think what you really want is an
extension.  A plugin is kind of a DLL that can view certain embedded
content in a page, whereas an extension is .  Extensions are more
versatile and easier to program.

Second, the de jure official language of Firefox extensions is
Javascript, and you might want to consider writing the script in that
(if you intend to have but haven't yet written it).  It's surprisingly
not a bad language.

But if you need Python, the most straightforward thing to do is write a
small wrapper extension that starts the Python interpretter to do the
dirty work.  The dialog box may be easier done in the extension itself
and not in Python subprocess.

For details, google for tutorials on writing Firefox extensions.

-- 
CARL BANKS




More information about the Python-list mailing list