Results 1 to 2 of 2
  1. #1
    robby14 is offline Member
    Join Date
    Feb 2010
    Posts
    15
    Rep Power
    0

    Default opening default browser window in invisible mode

    Hi,

    I am trying to open a default browser window, having a specific url, through a java application. I need to open the window in invisible(hidden) mode.
    Moreover I need to save the source file as an html file.

    can anyone give me any suggestions pls of how I can go around this problem?


    thanks

  2. #2
    travishein's Avatar
    travishein is offline Senior Member
    Join Date
    Sep 2009
    Location
    Canada
    Posts
    684
    Rep Power
    6

    Default

    so, are you interested in having a URL fetched and saved as a file on the local system.
    Such as you don't need to have the contents displayed?

    In this case, usingthe commons-httpclient, or the Java URL HTTP Connection would likely be a more direct way to do this.

    But also, I do not know of a way for Java to invoke a general web browser in a generic way to do this. Some browsers, such as firefox take command line paramters, its in theory possible to use the process builder to launch a browser instance and have it load a URL, but the making the browser minimized is not something that can be controlled with a command line parameter. I'm sure other browsers are the similar situation, where starting off minimized would be a feature of the window manager, such as KDE or Gnome, or Windows. And certainly if we were able to set up a command line sequence that does cause a browser to start up minimized and fetch content, we would not be able to instruct it to save the contents.

    Actually, along the line of using java to invoke a system process. it is likely possible you could use the 'wget' command (assuming unix environment, or you happen to find a windows port that has this command, such a cygwin). that is a command line HTTP fetching content application. However the Java HTTP URL connection is likely a better option from within Java.

    Hope that helps

Similar Threads

  1. Replies: 4
    Last Post: 10-07-2009, 09:14 AM
  2. Excel sheet opening in read-only mode
    By swati.jyoti in forum Advanced Java
    Replies: 2
    Last Post: 09-08-2009, 02:08 PM
  3. Opening Text Files with Default System Editor
    By Pesch in forum Advanced Java
    Replies: 5
    Last Post: 10-08-2008, 06:17 PM
  4. getting the default browser+MIME data
    By waleed_cs2000 in forum Networking
    Replies: 1
    Last Post: 04-08-2008, 01:31 PM
  5. Connecting to a Website with the default browser
    By Riftwalker in forum Java Applets
    Replies: 4
    Last Post: 12-04-2007, 04:57 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •