Welcome Guest Search | Active Topics | Sign In | Register

WebView Debugging instance correlation Options
Roei Ben-Harush
Posted: Monday, August 6, 2018 3:56:40 PM
Rank: Member
Groups: Member

Joined: 11/13/2015
Posts: 29
Hello,
When running an embedded WebView and lunching a browser (chrome) to the dubug port (localhost:9000), I get a list of opened instances.
Same as if I would go to localhost:9000/json/list, but I see no way to correlate the instance I'm trying to debug with the debugger list item (which have GUID-like IDs).
Is there a way to get the same ID from the WebView so I can correlate them?

In essence, what I'm trying to do is to create an F12 dev tool experience, which when the user hits F12 a new WebView will be launched and pointed directly to the debug session of the WebView instance from which F12 was used.

Thanks
eo_support
Posted: Monday, August 6, 2018 4:37:59 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,258
Hi,

Yes. You would call this method on the WebView for which you wish to debug:

https://www.essentialobjects.com/doc/eo.webbrowser.webview.showdevtools.aspx

Note that you will need to provide a valid window handle to this method because the window handle represents the "container" of the debug UI.

Thanks!
Roei Ben-Harush
Posted: Wednesday, August 8, 2018 8:55:35 PM
Rank: Member
Groups: Member

Joined: 11/13/2015
Posts: 29
Thank you for the quick reply!

What is the specifications of the window for which I need to provide the handle of?
If I have another winform with an EO.WinForm.WebControl, do I provide the handle of that window?
I tried doing that and nothing happened.
Roei Ben-Harush
Posted: Wednesday, August 8, 2018 9:14:09 PM
Rank: Member
Groups: Member

Joined: 11/13/2015
Posts: 29
OK, I figured it out. it was simpler than I thought.
All you have to do is create a new System.Windows.Forms.Form and provide the its handle.

here's a code snippet for future reference:

Code: C#
var devTools = new System.Windows.Forms.Form();
devTools.Load += (sender, e) => webForm.WebView.ShowDevTools(devTools.Handle);
devTools.Show(form);
eo_support
Posted: Thursday, August 9, 2018 3:52:33 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,258
Great. Thanks for sharing!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.