How can I completely disable browser-like features in a CEF-based custom game launcher?
03:32 11 Nov 2025

I'm developing a custom game launcher using CEF (Chromium Embedded Framework) on Windows.
The goal is to use CEF as a UI renderer only — not as a web browser.

However, I’m running into an issue:
Even though I’ve disabled most browser-related options, users can still trigger browser-like behavior such as:

  • Ctrl + Shift + I → DevTools opening

  • window.open() → new blank popup windows

  • right-click → default context menu

  • hovering links → shows the URL in status bar

  • selectable text, clipboard access, etc.

I’ve already tried:

settings.windowless_rendering_enabled = true;
settings.command_line_args_disabled = true;
cmd->AppendSwitch("disable-dev-tools");
cmd->AppendSwitch("disable-extensions");
cmd->AppendSwitch("no-sandbox");
cmd->AppendSwitch("disable-popup-blocking");

And in my CefClient subclass (MiniClient), I’m handling:

  • OnBeforePopup → return true

  • OnOpenURLFromTab → block non-current tabs

  • OnBeforeBrowse → block chrome://, devtools://

  • OnBeforeDevToolsPopup → set *use_default_window = false

  • OnChromeCommand(IDC_DEV_TOOLS) → return true

Despite this, new popup windows still open occasionally (blank window), and DevTools sometimes bypasses the handler.


What I want:

I want my CEF instance to behave like an embedded UI engine (for my game launcher), not like a browser at all —
no DevTools, no context menus, no new windows, no right-click, no shortcuts, etc.

Basically:

“CEF should behave like a sandboxed WebView — completely non-interactive outside of my app’s UI logic.”


What I’ve tried:

  • Overriding all handlers (CefLifeSpanHandler, CefRequestHandler, CefContextMenuHandler, etc.)

  • Returning true in OnBeforePopup

  • Using windowInfo.SetAsWindowless(nullptr)

  • Disabling everything through OnBeforeCommandLineProcessing

Still, popups can appear or DevTools can open under some conditions.


Questions:

  1. Is there a reliable way to disable all browser-level behaviors (popup, DevTools, context menus, etc.) in CEF 141?

  2. Can I somehow enable or use chrome_runtime to gain stricter control over popup / DevTools creation?

  3. Is it possible to compile CEF in a true “UI-only” mode (no chrome://, no internal browser capabilities)?

Any guidance or minimal example that shows how to turn CEF into a pure renderer would be very helpful.

c++ chromium-embedded