hi all
I want to ask : how to get the current system default browser by java code at runtime (IE,firefox,...)? and how to get its specific version ? also how to get the supported MIME type of that browser also by java code?
this is intended to be part of a network agent by java.
thanks
Comments
: I want to ask : how to get the current system default browser by
: java code at runtime (IE,firefox,...)? and how to get its specific
: version ? also how to get the supported MIME type of that browser
: also by java code?
:
: this is intended to be part of a network agent by java.
: thanks
For windows this can be found in the registry. One possible location is HK_CLASSES.htm and HK_CLASSES.html. I don't know if/where other OSes store their default browser.
Note: Applets can only access the registry with special privileges.
: : I want to ask : how to get the current system default browser by
: : java code at runtime (IE,firefox,...)? and how to get its specific
: : version ? also how to get the supported MIME type of that browser
: : also by java code?
: :
: : this is intended to be part of a network agent by java.
: : thanks
:
: For windows this can be found in the registry. One possible location
: is HK_CLASSES.htm and HK_CLASSES.html. I don't know if/where other
: OSes store their default browser.
: Note: Applets can only access the registry with special privileges.
I guess if you're using an applet, there should be a way to test in what browser the applet is running
Googled found this:http://www.rgagnon.com/javadetails/java-0160.html
: : : I want to ask : how to get the current system default browser by
: : : java code at runtime (IE,firefox,...)? and how to get its specific
: : : version ? also how to get the supported MIME type of that browser
: : : also by java code?
: : :
: : : this is intended to be part of a network agent by java.
: : : thanks
: :
: : For windows this can be found in the registry. One possible location
: : is HK_CLASSES.htm and HK_CLASSES.html. I don't know if/where other
: : OSes store their default browser.
: : Note: Applets can only access the registry with special privileges.
:
: I guess if you're using an applet, there should be a way to test in
: what browser the applet is running
:
: Googled found this:http://www.rgagnon.com/javadetails/java-0160.html
The browser, in which the applet runs, is given as one of the system properties. Here's the code to get that value:
[code]
String browserName = System.getProperty("browser");
[/code]
The question then becomes: is that browser the default browser?