-
Notifications
You must be signed in to change notification settings - Fork 566
Description
Is your feature request related to a problem? Please describe.
There is currently no CEF API to programmatically interact with browser components. Chrome provides chrome://components to view registered components and trigger on-demand updates, but this functionality is not exposed to CEF clients.
This makes it difficult to:
- Check if a required component is installed and what version it has
- Programmatically trigger component updates when needed
- Build diagnostic or troubleshooting UI that displays component status
Describe the solution you'd like
Expose a CEF API that allows clients to:
- Discover available components - Retrieve a list of all registered components with their metadata (ID, name, version, installation status)
- Query component information - Check if a specific component is installed and get its version
- Trigger on-demand updates - Request updates for specific components, similar to clicking "Check for update" in
chrome://components - Receive callbacks - Get notified when update operations complete with success/error status
The API should follow the CefMediaRouter pattern where wrapper objects (CefComponent) hold component info and provide methods directly on the object (e.g., component->RequestUpdate()) rather than requiring clients to pass component IDs to a central updater.
Example usage:
// List all components
CefRefPtr<CefComponentUpdater> updater = CefComponentUpdater::GetComponentUpdater();
std::vector<CefRefPtr<CefComponent>> components = updater->GetComponents();
for (const auto& component : components) {
LOG(INFO) << component->GetName() << ": " << component->GetVersion()
<< " (installed: " << component->IsInstalled() << ")";
}
// Update a specific component
CefRefPtr<CefComponent> component = updater->GetComponentByID(component_id);
if (component && !component->IsInstalled()) {
component->RequestUpdate(CEF_COMPONENT_UPDATE_PRIORITY_FOREGROUND, callback);
}Describe alternatives you've considered
-
Instruct users to use chrome://components - Requires manual user intervention and is not user-friendly for end users of CEF-based applications.
-
Wait for automatic component updates - The component updater runs on its own schedule, which may not align with application needs. Some components may take hours to update or may fail silently.
Additional context
- The implementation requires a small Chromium patch to add CEF classes as friends to
OnDemandUpdater(similar to existing friends likeComponentsHandler)
Proposed API surface:
// CefComponentUpdater (static factory)
static CefRefPtr<CefComponentUpdater> GetComponentUpdater();
std::vector<CefRefPtr<CefComponent>> GetComponents();
CefRefPtr<CefComponent> GetComponentByID(const CefString& component_id);
// CefComponent
CefString GetID();
CefString GetName();
CefString GetVersion();
bool IsInstalled();
void RequestUpdate(cef_component_update_priority_t priority,
CefRefPtr<CefComponentUpdateCallback> callback);
// CefComponentUpdateCallback
void OnComplete(cef_component_update_error_t error);