[EMAIL PROTECTED] (Jean Schurger) wrote in message 
news:<1011181863.17639.0.camel@come>...
> Hi,
> 
>       How can i set/change the proxy for an already runnning Mozilla ? is
> there a command to so that ?
> 
>       Thanks.


You can add some codes to EmbedPrivate::StartUpProfile() in EmbedPrivate.cpp
such as:


    nsCOMPtr<nsIPref> pref;      
    pref = do_GetService(NS_PREF_CONTRACTID);
    if (!pref)
      return NS_ERROR_FAILURE;

                const char *preference_name; 
                const char *new_value;          
                preference_name="network.proxy.http";
                new_value="192.168.29.223";  // you can change it 
                pref->SetCharPref (preference_name, new_value);

                const char      *preference_name1;
                gint  new_int_value;
                preference_name1="network.proxy.http_port";
                new_int_value=3128;      // you can change it   
                pref->SetIntPref (preference_name1, new_int_value);

                const char      *preference_name2;
                gint  new_int_value1;
                preference_name2="network.proxy.type";
                new_int_value=1;                
                pref->SetIntPref (preference_name2, new_int_value1);

    sPrefs = pref.get();
    NS_ADDREF(sPrefs);

    sPrefs->SavePrefFile(nsnull);      // save to default file
    sPrefs->ReadUserPrefs(nsnull);    // read from default file 

There are many fuctions In nsIPref.idl.You can see it.

Reply via email to