On 8/24/07, Victor Osório <[EMAIL PROTECTED]> wrote:
>
>     Thanks, but I can't change the Mozilla code, licence problems.


You don't need to change any Mozilla code.

All you need to do is add that line to the prefs.js file.  Open it using
Java or Eclipse methods.

I am insterested in the
> setting of proxy host & port for the browser thru APIs on the Browser
> class. There is a way?


Since the JavaScript code didn't work for you, you can try calling the same
from Java.

Open the browser to "about:blank" (so that it doesn't try to load anything
from the network).  Then get the pref service and set the proxy preference.
Something like this:
        nsIServiceManager servMgr = Mozilla.getInstance
().getServiceManager();
        nsIPrefBranch prefs = (nsIPrefBranch) servMgr.getServiceByContractID(
"@mozilla.org/preferences-service;1",
                nsIPrefBranch.NS_IPREFBRANCH_IID );
        prefs.setIntPref("network.proxy.http_port",8080);

(NOTE: I haven't tested the above code, but I believe it is correct).

Basically, many things that can be done in JavaScript can also be done in
Java.  Give it a shot...


Javier Pedemonte
ATF Developer
_______________________________________________
atf-dev mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/atf-dev

Reply via email to