Mozilla preferences are stored in a .mozilla directory for each user, in their home directory. Thanks to Dr. Li, that I could find this out. Now if you run a program that uses SWT Browser, you can see a a folder "Eclipse" inside this .mozilla directory.
[Note I am talking about running a Java Program which has SWT Browser, from ECLIPSE, thus the folder name is eclipse. If you run from console, you might have a different foldername(I guess as that of the program name)]
It is in the /home/
user_pref("networking.http.pipelining",true);
Close Eclipse and start again. Now when you launch the program, the browser would use this preference.
Another way is to use "about:config" within your program do the configuration!
For this you can just write a configure() function and use it when you want. The function can be something like
Class ConfigurationWindow
{
public void configure()
{
Display display = new Display();
Shell shell = new Shell(display);
Browser browser = new Browser(shell,SWT.CENTER);
shell.setLayout(new GridLayout());
browser.setUrl("about:config");
shell.open();
while(!shell.isDisposed())
if(!display.readAndDispatch()) display.sleep();
shell.dispose();
display.dispose();
browser.dispose();
}
}
Now you can create new instance of ConfigurationWindow and call configure() which shows the user preferences window, just like the one you get when you type about:config in Mozilla Firefox.
This way one can configure preferences for Swt Browser Widget!
1 comment:
If the underlying html renderer is XULRunner then the preferences can also be changed programatically via JavaXPCOM. For a simple example of this see https://bugs.eclipse.org/bugs/show_bug.cgi?id=82295#c18
Post a Comment