Repository navigation
Description
Is your feature request related to a problem? Please describe.
Use of the Chrome or Alloy runtime must currently be configured at app startup and cannot be mixed in a single app instance. Each runtime has its own strengths and weaknesses. For example:
- Chrome runtime supports the full Chrome UI and functionality (details).
- Alloy runtime supports off-screen rendering, client-provided parent windows, and some callbacks that are missing with the Chrome runtime (issues).
Describe the solution you'd like
Start with the Chrome runtime. Add the ability to create lightweight (Alloy-style) windows and browsers that behave the same as existing Alloy windows/browsers. This would include support for the following:
- Off-screen rendering with Chrome runtime via Alloy-style browser (issue chrome: Add support for off-screen rendering #3293).
- Client-provided parent windows with Chrome runtime via Alloy-style browser (issue chrome: Add support for embedded non-Views windows #3294).
- Multiple browsers in a single Chrome window (1 Chrome browser + multiple Alloy-style browsers). For example, the Alloy-style browsers might contain web-based controls separate from the main browser view (with different CefRequestContext, etc).
Additional context
Chrome runtime bootstrap means that all global objects and CefRequestContext (Profile) will be Chrome objects. For Alloy-style we will create Widget and WebContents objects directly (like with current Alloy runtime) and modify the existing Alloy implementations to work with Chrome global objects. This can be done in stages:
- Use per-browser/window state instead of global IsChromeRuntimeEnabled/IsAlloyRuntimeEnabled functions.
- Add argument to CefBrowserHost/CefWindow creation to specify Chrome or Alloy style. Chrome style windows can contain Alloy style browsers, but not visa-versa. Some of this behavior may be implicit (for example, always create Alloy style with off-screen rendering or when a parent window handle is specified).
- Fix various issues with Alloy* implementations to make it all work nicely.
- Delete the Alloy runtime bootstrap and related unused classes. Chrome runtime bootstrap becomes the only option.
Activity
chrome: Add support for Alloy style browsers and windows (see #3681)
magreenblatt commentedon Apr 22, 2024
Remaining work:
Add support for CefDownloadHandler API.(DONE)views: Add Chrome theme support for Alloy style BrowserView in Chrome style Window.(DONE)views: Test multiple Alloy style BrowserViews in a single Window.(DONE)Add build configuration to disable Alloy bootstrap.(DONE)magreenblatt commentedon Apr 24, 2024
Test cases have been updated at https://bitbucket.org/chromiumembedded/cef/wiki/ChromiumUpdate#markdown-header-5-run-cef-tests
chrome: osr: Create CefWebContentsViewOSR for guest views (see #3681)
chrome: Add extension support for Alloy style browsers (see #3681)
chrome: Add CefDownloadHandler support (see #3681)
chrome: osr: Fix performance manager init (see #3681)
Add GN arg to disable Alloy bootstrap (see #3681, see #3685)
Add DISABLE_ALLOY_BOOTSTRAP to cef_config.h (see #3681, see #3685)
views: Support themes for Alloy BrowserView in Chrome Window (see #3681)
cefclient: Don't call GetExtension when NOTIMPLEMENTED (see #3681)
tools: Don't write args.gn if unchanged (see #3681, see #3685)
views: Support themes for Alloy BrowserView in Chrome Window (see #3681)
magreenblatt commentedon May 20, 2024
It appears that DevTools frontend #initializeTarget never completes (


await runnableInstanceFunction().run()never returns when running the InspectorMainImpl), and consequently DevToolsUIBindings::ReadyForTest is never called. Adding console.log statements in InspectorMainImpl shows thatwaitForPrimaryPageTargetnever resolves because targetManager.primaryPageTarget() returns null. It looks like the problem is parentTarget has type "browser" instead of the expected type "frame".Here are the expected |targets| when not using OSR:
It looks like BuildTargetInfo is passing the wrong |type| value ("other" vs the expected "page") to AttachedToTarget.
With OSR:
Without OSR:
Call stack:
magreenblatt commentedon May 20, 2024
The problem is ChromeDevToolsManagerDelegate::GetTargetType. The
AllTabContentsescase catches Chrome style browsers and theWebView::IsWebViewContentscase catches Alloy style windowed browsers, but there's no handling for OSR browsers.osr: Support DevTools windows with Chrome runtime Alloy style (see #3681
cefclient: Use default window for DevTools non-Views popup (see #3681)
osr: Support DevTools windows with Chrome runtime Alloy style (see #3681
cefclient: Use default window for DevTools non-Views popup (see #3681)
magreenblatt commentedon Dec 6, 2025
Test coverage added in this commit.