Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chrome: Add generic solution for executing any Chrome command #3282

Closed
magreenblatt opened this issue Mar 18, 2022 · 4 comments
Closed

chrome: Add generic solution for executing any Chrome command #3282

magreenblatt opened this issue Mar 18, 2022 · 4 comments
Labels
chrome Related to the Chrome runtime enhancement Enhancement request Framework Related to framework code or APIs

Comments

@magreenblatt
Copy link
Collaborator

Original report by me.


DevTools window control (ShowDevTools; needed for V8Test.OnUncaughtExceptionDevTools; currently accessible via the Chrome UI).

@magreenblatt
Copy link
Collaborator Author

See issue #2969 for background on the Chrome runtime.

@magreenblatt
Copy link
Collaborator Author

This would likely work via chrome::ToggleDevToolsWindow or by passing IDC_DEV_TOOLS_INSPECT to chrome::ExecuteCommand. I’m leaning towards the latter as a nice generic solution for executing any Chrome command (now partially exposed via issue #3280).

In other words, we wouldn’t support ShowDevTools as-is but instead expose a generic capability to execute Chrome commands.

@magreenblatt magreenblatt changed the title chrome: Decide what to do with ShowDevTools chrome: Add generic solution for executing any Chrome command Mar 15, 2023
@magreenblatt
Copy link
Collaborator Author

This involves 2 new capabilities:

  1. Checking if a command is enabled by default (possibly with new CefCommandHandler callback similar to IsChromeAppMenuItemEnabled)
  2. Executing the command (possibly with CefCommandHandler::OnChromeCommand callback)

@magreenblatt
Copy link
Collaborator Author

magreenblatt added a commit that referenced this issue Nov 14, 2023
…ixes #3600)

Add new CefBrowserHost::[Can]ExecuteChromeCommand methods for executing
arbitrary Chrome commands.

Add support for existing CefBrowserHost::ShowDevTools, CloseDevTools and
HasDevTools methods.

DevTools windows now support the same Views callbacks as normal popup
windows with the new CefLifeSpanHandler::OnBeforeDevToolsPopup callback
as the DevTools-specific equivalent of OnBeforePopup.

Always create DevTools as an undocked window to support use of
ShowDevTools with default Chrome browser windows.

To test:

Run `ceftests --enable-chrome-runtime [--use-views]
     --gtest_filter=V8Test.OnUncaughtExceptionDevTools`

OR:

1. Run `cefclient --enable-chrome-runtime [--use-native]`
2. Select "Show DevTools", "Close DevTools" or "Inspect" from the
   right-click menu.
3. Notice that the DevTools window is Views-hosted (or native-hosted)
   and works as expected.

Add --use-default-popup to get a default styled popup in step 3.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chrome Related to the Chrome runtime enhancement Enhancement request Framework Related to framework code or APIs
Projects
None yet
Development

No branches or pull requests

1 participant