cef icon indicating copy to clipboard operation
cef copied to clipboard

[Docs] Severe disconnect between official documentation and actual C++ API headers (DX Crisis)

Open Ernest12287 opened this issue 3 months ago • 3 comments

Description

There is currently a massive, frustrating disconnect between the official CEF documentation (Wiki, tutorials, and API references) and the actual C++ source code (the header files).

As a developer building a complex, multi-process application using the latest CEF binaries (M151+), I have found that roughly 90% of the documented APIs are either outdated, renamed, or completely missing from the actual headers. Conversely, many critical modern APIs present in the headers have zero documentation.

The Problem

The official documentation is no longer the source of truth; the C++ headers (include/cef_*.h) are the only reliable source of truth.

Because the docs lag so far behind the actual codebase, developers are being forced to abandon the documentation entirely and reverse-engineer the framework by reading the raw C++ header files and internal implementation details just to figure out how to use basic features.

Specific Pain Points:

  1. Outdated Tutorials: The "General Usage" and "Tutorial" pages reference older paradigms and miss critical modern context (especially regarding the Alloy vs. Chrome runtime split introduced in M125+).
  2. Views Framework Documentation: The CEF Views framework (include/views/) is crucial for building custom UIs without native OS toolkits, but the documentation on how to properly compose, layout, and manage the lifecycle of CefBrowserView, CefPanel, and CefWindow is practically non-existent.
  3. Multi-Process / Threading Nuances: The docs say "check the header comments," but the header comments often lack the specific context of which process (Browser vs. Renderer) and which thread (TID_UI, TID_IO, TID_RENDERER) a callback actually fires on, leading to fatal cross-thread crashes.
  4. JavaScript/V8 Integration: The documentation for OnContextCreated, CefMessageRouter, and V8 bindings is fragmented. It does not clearly explain the modern, safe way to inject scripts into an isolated world before the DOM exists (a critical feature for modern scraping/automation tools).

Real-World Impact

  • Massive Time Sink: Developers spend days reading through cef_client.h, cef_life_span_handler.h, and cef_render_process_handler.h just to map out the lifecycle, because the Wiki is outdated.
  • High Barrier to Entry: New adopters hit a wall immediately because the "getting started" guides do not match the compiler errors they get from the actual headers.
  • Reliance on Community/Source: Developers are forced to dig through tests/cefclient/ or ask on the forum just to find working code snippets for modern CEF.

Proposed Solution / Request

  1. Audit and Update the Wiki: The Wiki pages (especially General Usage, Architecture, and JavaScript Integration) need a complete rewrite to reflect the modern CEF3 codebase (M125+), specifically addressing the Chrome/Alloy runtime differences.
  2. Auto-Generate or Sync API Docs: If manual docs are too hard to maintain, please provide a robust, searchable, Doxygen-style generated API reference directly from the include/ headers, hosted on the official site.
  3. Modernize the Examples: Update cefsimple and cefclient to clearly demonstrate modern patterns (e.g., using the Views framework for a custom HTML/CSS/JS UI shell, proper CefMessageRouter usage, and correct thread-hopping via CefPostTask).
  4. Explicit Threading/Process Tags: Add strict, standardized Doxygen tags in the headers (e.g., @process Browser, @thread TID_UI) so developers can instantly see the execution context without guessing.

Environment

  • CEF Version: 151.3.24+g2384915+chromium-151.0.7922.174 (Linux 64-bit)
  • OS: Linux (Ubuntu/Debian based)
  • Build System: CMake 3.21+

Additional Context

CEF is an incredibly powerful engine, and the fact that apps like Spotify, Steam, and Epic Games use it proves its worth. But the Developer Experience (DX) right now is incredibly painful because the map (documentation) no longer matches the terrain (the source code).

Please help us help you by bringing the documentation up to speed with the actual C++ API. Thank you for your hard work on this project!

Ernest12287 avatar Sep 04 '26 09:09 Ernest12287

Please don't post AI-generated slop. Documentation is extensive and audited for accuracy regularly. Sample apps demonstrate almost everything not explicitly covered. Auto-generated doxygen is also available. Classes and methods document the process and thread requirements.

magreenblatt avatar Sep 04 '26 14:09 magreenblatt

ok

Ernest12287 avatar Sep 04 '26 17:09 Ernest12287

but that comment hurt brother that realy did one day i promise you before i die i will make a chromium browser wrapper i promise you that i will take my ai slop with it thanks but a side note just make the api simple and instructions easy for everyone to understand even us who we use ai ok but thanks anyway

Ernest12287 avatar Sep 04 '26 19:09 Ernest12287