0

I'm developing a command line tool and at some point it redirects the user to the default web browser. I use the following code for that

 if(Desktop.isDesktopSupported()){
        Desktop.getDesktop().browse(new URI("http://www.example.com"));
 }

The browser opens without any problem but there are some messages printed on the console while this is up. stuff like

 [6620:6620:0622/180058:ERROR:browser_window_gtk.cc(1082)] Not implemented reached in virtual void BrowserWindowGtk::WebContentsFocused(content::WebContents*)

or

Created new window in existing browser session.

Is there a way to stop printing these kind of messages. (as it is a command line application it does not look good). Is there any other way to open a browser?

Thanks in advance

Chamila Adhikarinayake
  • 3,588
  • 5
  • 25
  • 32

1 Answers1

0

This looks like this is printed by the browser on startup. These GTK log messages aren't uncommon.

You can start the browser directly from the console to verify this.

EDIT: As starting the browser is handed off to an operating system specific method, there's not much control over it. To have better control you can try to launch the browser directly:

You can use Desktop.browse if the other methods fail.

Community
  • 1
  • 1
Kris Scheibe
  • 361
  • 2
  • 5