Skip to content

ShowDevTools with SetAsPopup no longer creates a new window #5000

@oscar-articulate

Description

@oscar-articulate

Is there an existing issue for this?

  • I have searched both open/closed issues, no issue already exists.

CefSharp Version

130.1.90

Operating System

Windows 10

Architecture

x64

.Net Version

net4.8

Implementation

WinForms

Reproduction Steps

When using 124.3.80, the below code would create a new windows form with our application (the host's) icon to host the dev tools in it. It would also show up in the task bar.

Now, with 130.1.90, the below code creates an edgeless form (?) with no title bar, close/minimize/maximize, etc.

var host = browser.GetBrowserHost();

var windowInfo = new WindowInfo();
windowInfo.SetAsPopup(host.GetWindowHandle(), "DevTools");

browser.ShowDevTools(windowInfo);

Expected behavior

a new window (forms/wpf) with title bar, minimize/maximize/close, etc, is created that hosts the dev tools, and inherits the main application's icon.

image

Actual behavior

an edgeless dev tools shows up with no title bar, minimize/maximize/close is created, and a (blue) chromium icon is shown
image

Regression?

yes, worked in version 124.3.80

Known Workarounds

My workaround is to create a new form and use the extensions:

var devToolsForm = new Form(); 
var devToolsControl = CefSharp.WinForms.WebBrowserExtensions.ShowDevToolsDocked(this, devToolsForm);
devToolsForm.Show(mainApplicationForm);

and another workaround is:


            var windowInfo = new WindowInfo
            {
                WindowlessRenderingEnabled = true
            };

This applies to both WPF and Forms.

I know that the alloy stuff was removed, and I'm guessing it's related to this.

Does this problem also occur in the CEF Sample Application

yes; modify in BrowserForm.cs

        private async void ShowDevToolsMenuItemClick(object sender, EventArgs e)
        {
            var control = GetCurrentTabControl();
            if (control != null)
            {
                var isDevToolsOpen = await control.CheckIfDevToolsIsOpenAsync();
                if (!isDevToolsOpen)
                {
                    var host = control.Browser.GetBrowserHost();

                    var windowInfo = new WindowInfo();
                    windowInfo.SetAsPopup(host.GetWindowHandle(), "DevTools");

                    control.Browser.ShowDevTools(windowInfo);
                }
            }
        }

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    upstreamThese issues require fixing in the Chromium Embedded Framework(CEF) or Chromium.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions