|
Rank: Advanced Member Groups: Member
Joined: 1/12/2015 Posts: 81
|
I cannot get the developer tools to show in version 18.0.55. Here is the code I'm using where frmBrowser is the windows form:
Code: C#
WebView wb = new WebView();
var wc = new PictureBox();
wc.Width = frmBrowser.Width;
wc.Height = frmBrowser.Height - 200;
frmBrowser.Controls.Add(wc);
wb.Create(wc.Handle);
var wd = new Panel();
wd.Width = wc.Width;
wd.Height = 200;
wd.Location = new Point(wc.Location.X, wc.Height);
frmBrowser.Controls.Add(wd);
wb.ShowDevTools(wd.Handle);
I also tried to wait until wb.IsReady (as read in another topic) but it's still not showing.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,218
|
Hi,
It might be that you are doing it too fast. You can try to delay ShowDevTools call and see if it works for you.
Thanks!
|
|
Rank: Advanced Member Groups: Member
Joined: 1/12/2015 Posts: 81
|
I've tried delaying for a while but it's still not showing up.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,218
|
Can you send a simple test app to us? See here for more details: https://www.essentialobjects.com/forum/test_project.aspxThanks
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,218
|
Hi, Please change your code to this:
Code: C#
WebView wb = new WebView();
var wc = new PictureBox();
wc.Width = this.Width;
wc.Height = this.Height - 200;
this.Controls.Add(wc);
wb.Create(wc.Handle);
var wd = new Panel();
wd.BorderStyle = BorderStyle.FixedSingle;
wd.Width = wc.Width;
wd.Height = 200;
wd.Location = new Point(wc.Location.X, wc.Height);
this.Controls.Add(wd);
wb.IsReadyChanged += (sender, e) =>
{
if (wb.IsReady)
wb.ShowDevTools(wd.Handle);
};
Your code that uses Task.Run does not work because you would be calling wd.Handle in a separate thread. This is not allowed and will throw an exception. Since wd.Handle already throws an exception, wb.ShowDevTools is not called at all in your code. Please let us know if you still have any question. Thanks!
|
|
Rank: Advanced Member Groups: Member
Joined: 1/12/2015 Posts: 81
|
That worked. Thanks.
Is there any way to pre-select the network tab after the developer tools have loaded?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,218
|
Hi,
No. There is no way for you to automate the developer tools UI.
Thanks
|
|
Rank: Advanced Member Groups: Member
Joined: 1/12/2015 Posts: 81
|
I'm using this code you sent me: eo_support wrote:
Code: C#
WebView wb = new WebView();
var wc = new PictureBox();
wc.Width = this.Width;
wc.Height = this.Height - 200;
this.Controls.Add(wc);
wb.Create(wc.Handle);
var wd = new Panel();
wd.BorderStyle = BorderStyle.FixedSingle;
wd.Width = wc.Width;
wd.Height = 200;
wd.Location = new Point(wc.Location.X, wc.Height);
this.Controls.Add(wd);
wb.IsReadyChanged += (sender, e) =>
{
if (wb.IsReady)
wb.ShowDevTools(wd.Handle);
};
But when I immediately call wb.LoadUrl and switch over to the network tab, I don't see the URLs listed there. Is there a way to wait for the ShowDevTools to finish loading?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,218
|
Hi,
Can you send a test project to us with your order number? We provide free tech support for one year after the purchase. We are not able to locate any order in our system under your email, so please let us know your order number so that we can check support status.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 5/21/2019 Posts: 1
|
I'm using as below;
private void ShowDevTool() {
var win = new System.Windows.Forms.Form(); win.Width = 1000; win.Height = 800; win.TopMost = true; webBrowser.ShowDevTools(win.Handle); win.Show(); }
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,218
|
yang wrote:I'm using as below;
private void ShowDevTool() {
var win = new System.Windows.Forms.Form(); win.Width = 1000; win.Height = 800; win.TopMost = true; webBrowser.ShowDevTools(win.Handle); win.Show(); } Your code looks fine (except that we do not support TopMost). If you still have problems, please send us a test app and your order number and we will investigate further.
|
|