Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [atf-dev] Mozilla Browser proxy configuration

Works, Thanks....

I will post in the bug a comments saying what a have done....


2007/8/24, Javier Pedemonte <jhpedemonte@xxxxxxxxx >:
On 8/24/07, Victor Osório < xmv746@xxxxxxxxxxxx> 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
atf-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/atf-dev




--
Grato,
Victor Emanuel

Back to the top