Can Java's Desktop library launch a URL in a new Browser Tab or Window?

后端 未结 5 1146
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-06 14:49

I have a static method used to launch a browser with a given URL. When the browser is already open, this takes over the active browser window.

This is a problem if t

5条回答
  •  北海茫月
    2020-12-06 15:24

    You can use Yose method to identify which browser is default and then use the following commands:

    firefox.exe -new-tab ie7 http://blogs.msdn.com/tonyschr/archive/2007/01/19/ie-automation-amp-tabs.aspx opera -newpage

    Note that some browsers do not support tabs, or have no command line params to open an url in a tab. In that case you can use AHK scripting engine.

提交回复
热议问题