Page 1 of 1

Re: Open Developer Tools and bring focus to the console

Posted: Fri Jun 23, 2017 12:47 pm
by salvadordf
Hi,

There are only a couple of functions to handle the DevTools : ShowDevTools and CloseDevTools.

However, the DevTools store some settings in the "User data path". Set GlobalCEFApp.UserDataPath before calling GlobalCEFApp.StartMainProcess to test the following code.

When your browser is fully loaded call ShowDevTools setting inspectElementAt like this :

Code: Select all

inspectElementAt.x := low(integer); 
inspectElementAt.y := low(integer);
When you call ShowDevTools with that parameter you'll see the DevTools and it won't try to inspect an HTML element.

At that moment, click on the console tab and close the DevTools. The next time you show the DevTools the console will still be selected by default.

The real problem comes when you want to copy some of the information shown in the DevTools. As far as I know, there's no way to do that using CEF3.

Maybe you can use the Windows APIs to find the control with the URL and copy it somehow.

Another possibility is emulating the remote debugger. Read this :
http://magpcss.org/ceforum/viewtopic.php?f=6&t=11952
It looks like you can read all the DevTools information using JSON.

Re: Open Developer Tools and bring focus to the console

Posted: Fri Jun 23, 2017 3:34 pm
by salvadordf
My mistake. :oops:

I repeated the information that I found and it turned out to be outdated information.

I guess you will have to try the remote debugging alternative.

Re: Open Developer Tools and bring focus to the console

Posted: Fri Jun 23, 2017 4:39 pm
by salvadordf
I'm glad to be of help :)