chromiumembedded / cef

Chromium Embedded Framework (CEF). A simple framework for embedding Chromium-based browsers in other applications.
https://bitbucket.org/chromiumembedded/cef/
Other
3.38k stars 467 forks source link

DevTools, Network : "Open in new tab" opens two windows. #3735

Closed HashidaTKS closed 4 months ago

HashidaTKS commented 4 months ago

Describe the bug

When executing "Open in new tab" of DevTools's Network tab, two windows open.

image

image

One is a client application style window and the other is a Chromium style window.

We can reproduce it on cefclient v126 and v127 for Windows.

To Reproduce

We can reproduce it with cefclient.

  1. Download cef_binary_127.0.9+gd77d001+chromium-127.0.6533.17_windows32_beta_client.tar.bz2
  2. Execute cefclient.exe
  3. Open DevTools
  4. Open a Network tab
  5. Right click an item in a Name column
  6. Select "Open in new tab"

Expected behavior

Only a client application style window opens.

Screenshots

Added at Describe the bug.

Versions (please complete the following information):

Additional context

Does the problem reproduce with the cefclient or cefsimple sample application at the same version?

Yes

Does the problem reproduce with Google Chrome at the same version?

No

magreenblatt commented 4 months ago

This is due to ClientHandler::OnOpenURLFromTab creating a new window in addition to the default Chrome behavior (DevToolsWindow::OpenInNewTab calls chrome::AddSelectedTabWithURL). We should try to disable the default behavior when OnOpenURLFromTab returns true.

magreenblatt commented 4 months ago

DevToolsWindow::OpenInNewTab calls chrome::AddSelectedTabWithURL

It looks like this case should not occur normally [1], so it should be safe to remove this fallback in DevToolsWindow.

[1] Browser::OpenURLFromTab will only return nullptr normally if the open is blocked by the popup blocker. However, that probably shouldn't trigger in this DevTools case.