firefox python plugin

Discussion in 'Python' started by M.N.A.Smadi, Mar 8, 2005.

  1. M.N.A.Smadi

    M.N.A.Smadi Guest

    hi;

    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

    any help is appreciated
    thanks
    m.smadi
    M.N.A.Smadi, Mar 8, 2005
    #1
    1. Advertising

  2. M.N.A.Smadi

    Carl Banks Guest

    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
    Carl Banks, Mar 8, 2005
    #2
    1. Advertising

  3. M.N.A.Smadi

    Thomas Ganss Guest

    M.N.A.Smadi schrieb:
    > hi;
    >
    > 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

    clientside processing could either be done in javascript (possibly
    disabled on some machines <g>) or in jython running as an applet.
    Storing processed data could be considered quite dangerous <BG>. You
    have to consider security settings / sandbox approaches here.

    Unless it is a specific issue for most use cases creating the processed
    file on the server and offering a link to download would be a better
    solution...

    HTH

    thomas
    Thomas Ganss, Mar 9, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. PilotYid
    Replies:
    1
    Views:
    609
    Andrew Thompson
    Oct 31, 2005
  2. Marcin Cenkier
    Replies:
    1
    Views:
    5,386
    Marcin Cenkier
    Apr 12, 2006
  3. Jimmy
    Replies:
    0
    Views:
    497
    Jimmy
    Mar 15, 2007
  4. Replies:
    1
    Views:
    713
  5. zelegolas

    Python plugin for Firefox

    zelegolas, Apr 17, 2008, in forum: Python
    Replies:
    2
    Views:
    425
    Todd Whiteman
    Apr 17, 2008
Loading...

Share This Page