Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
If you find these projects useful please consider becoming a sponsor with Patreon, GitHub or Liberapay.

Open Developer Tools and bring focus to the console

Post Reply
User avatar
salvadordf
Posts: 4564
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Open Developer Tools and bring focus to the console

Post 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.
User avatar
salvadordf
Posts: 4564
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Open Developer Tools and bring focus to the console

Post 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.
User avatar
salvadordf
Posts: 4564
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Open Developer Tools and bring focus to the console

Post by salvadordf »

I'm glad to be of help :)
Post Reply