-
-
Notifications
You must be signed in to change notification settings - Fork 60
Engine CefSharp
Sucrose.Live.CefSharp is Sucrose's bundled-Chromium browser engine, built on the Chromium Embedded Framework via CefSharp.Wpf.HwndHost with offscreen (windowless) rendering. It renders all five browser-capable types — Gif, Url, Web, Video, and YouTube — and is the default engine for Url, Web, and YouTube. Unlike WebView, it ships its own CEF native binaries and serves themes over a built-in local HTTP server. Together with WebView, it is one of the two engines that deliver Sucrose's audio-reactive and system-status JavaScript APIs. This page covers the technology, supported types, the VC++ runtime requirement and auto-download, CEF settings, command-line arguments, the local HTTP server, the JS bridge, the customization panel, and extra handlers.
- At a glance
- Technology
- Supported wallpaper types
- Runtime requirement and auto-download
- CEF settings
- Command-line arguments
- Local HTTP server
- JavaScript bridge: audio and system data
- Customization panel
- Extra handlers
- Strengths and limitations
- See also
| Property | Value |
|---|---|
| Assembly | Sucrose.Live.CefSharp.exe |
| Tech | CEF / CefSharp (CefSharp.Wpf.HwndHost, windowless rendering) |
| Supported types | Gif, Url, Web, Video, YouTube |
| Default for | Url, Web, YouTube |
| Preprocessor symbols |
ENGINE, LIVE_CEFSHARP
|
| Runtime requirement | VC++ Redistributable ≥ 14.40.33816.0 (auto-download offered) |
| Local serving | Built-in Watson.Lite HTTP server (http://localhost:{port}/) |
| Interactivity | Yes (uses RawInput.Sharp) |
| Audio/system-data injection | Yes (Web type) |
| Properties panel | PropertiesType.CefSharp |
CefSharp embeds the Chromium Embedded Framework through CefSharp.Wpf.HwndHost, running with offscreen / windowless rendering (WindowlessRenderingEnabled = true). The CEF native binaries are shipped with the engine, so unlike WebView it does not depend on a separately-installed evergreen runtime.
CefSharp renders all of Gif, Url, Web, Video, and YouTube, and is the default engine for Url, Web, and YouTube. It does not render the Application type (that is Aurora-only). See Type Url, Type Web, Type YouTube, Type Gif, and Type Video.
The pre-launch Check reads the Visual C++ Redistributable version from the registry (SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\{x86|x64|ARM64}) and requires ≥ 14.40.33816.0. If the installed version is too old, a dialog offers four options:
| Option | Behavior |
|---|---|
| Continue | Proceed anyway |
| Download | Fetch VC_redist.{arch}.exe from SMMRU.VCRedist and install it |
| Remember | Snooze the prompt |
| Close | Exit the engine |
See Runtime Dependencies and System Requirements.
The engine configures CefSettings with:
-
UserAgent = SMMG.UserAgent— the Sucrose user agent string. -
PersistSessionCookies = true. -
IgnoreCertificateErrors = true. - Cache folder
%AppData%\<App>\Cache\CefSharp. - Native log file
CefSharpNative-*.log. - Locale auto-selected from the
*.pakfiles matching the current culture.
Arguments come from the engine setting CefArguments (defaults in Internal.CefArguments, in dictionary form). They mirror WebView's flags, for example:
disable-gpu-compositing
off-screen-rendering-enabled=1
multi-threaded-message-loop
no-sandbox
autoplay-policy=no-user-gesture-required
| Setting | Effect |
|---|---|
HardwareAcceleration ON |
enable-gpu=1 + enable-gpu-vsync=1
|
HardwareAcceleration OFF |
disable-gpu=1 + disable-gpu-vsync=1 (skipped on Germanium) |
DeveloperPort (Developer Mode) |
sets RemoteDebuggingPort (handled like WebView's remote debugging) |
Germanium note: if the engine detects a Germanium Windows build variant (IsGermanium()), it removes the disable-gpu-compositing flag, and the Hardware-Acceleration-OFF GPU flags are skipped for that variant.
See Settings Wallpaper and Settings Other.
CefSharp serves the theme through a built-in Watson.Lite web server (SSECSEWWS = Sucrose.Shared.Engine.CefSharp.Extension.WatsonWebServer). LocalServer.Host() provides the base URL (http://localhost:{port}/), and the server is stopped on exit. This is the main delivery difference from WebView: WebView serves via file:///, while CefSharp serves the same theme over localhost HTTP. See Create Web Architecture.
CefSharp is one of the two engines (the other is WebView) that deliver Sucrose's live-data JavaScript APIs to Web-type wallpapers:
- The theme ships a
SucroseCompatible.jsondeclaring the JS callbacks it wants (SystemAudio,VolumeLevel,SystemBios,SystemDate,SystemTheme,SystemMemory,SystemBattery,SystemGraphic,SystemNetwork,SystemStorage,SystemProcessor,SystemMotherboard, plusLoopMode/ShuffleMode/ThemeType/StretchMode). - If
SystemAudiois declared, the engine flipsBackgroundog'sAudioRequiredflag, starts a communication channel (CommunicationType: Pipe / Signal / Transmission), and injects the data into the page via the browser'sExecuteScriptAsyncpath. - Customization controls are pushed via the property file watcher using the JS template
SucrosePropertyListener('{0}', {1});.
See Create Audio API, Create System API, Create JS Bridge, and Create Property Listener Filters.
When you click Customize on a CefSharp wallpaper, the Property service renders the PropertiesType.CefSharp panel from the CefProperties JSON. It exposes the same filter set as WebView:
| Control | Notes |
|---|---|
| scale (zoom) | — |
| saturate | — |
| hue-rotate | — |
| brightness | — |
| contrast | — |
| blur | — |
| grayscale | — |
| sepia | — |
| invert | — |
| mirror | Dropdown |
| animation | Flat / Flip / Pulse / Shake / Bounce / Wiggle |
| playbackRate | — |
| muted | Toggle |
| caption | Toggle |
See Customizing Wallpaper and Property Service.
The CefSharp shared project adds several Chromium-specific handlers and extensions beyond the common engine layer:
-
CustomContextMenu,CustomKeyboard,CustomDownloadhandlers. -
ScreenshotandInteractionextensions.
Strengths
- Default engine for Url, Web, and YouTube — no setup needed for the common web cases.
- Bundles its own CEF binaries, so it does not depend on an evergreen browser runtime being installed.
- Full support for audio-reactive and system-status Web wallpapers.
- Offscreen rendering plus extra handlers (context menu, keyboard, download, screenshot, interaction).
- Interactive (mouse/keyboard via
RawInput.Sharp).
Limitations
- Requires the VC++ Redistributable (≥
14.40.33816.0); offers an auto-download if missing. - Cannot render the Application type.
- Larger on-disk footprint than WebView because it ships CEF binaries; browser overhead is higher than native MpvPlayer for plain Gif/Video.
Getting Started
- Installation
- System Requirements
- Quick Start
- Portal Interface Tour
- Updating Sucrose
- Uninstalling Sucrose
Wallpaper Types
Using Sucrose
- Managing Library
- Using Store
- Customizing Wallpaper
- Multi-Monitor
- Wallpaper Cycling
- Choosing Engines
- Performance Rules
- Theme, Tray & Startup
- Discord Rich Presence
Settings Reference
- Settings Overview
- Settings: General
- Settings: Personal
- Settings: Performance
- Settings: Wallpaper
- Settings: System
- Settings: Other
- Settings: All Keys
Creating Wallpapers
- Create Overview
- Create: Step By Step
- Create: Package Format
- Create: Customization Controls
- Create: JS Bridge
- Create: Audio API
- Create: System API
- Create: Property Listener & Filters
- Create: Web Architecture
- Create: Compatibility
- Create: Example Wallpapers
- Create: Sharing & Publishing
Engine Reference
- Engines Overview
- Engine: MpvPlayer
- Engine: VlcPlayer
- Engine: WebView
- Engine: CefSharp
- Engine: Nebula
- Engine: Vexana
- Engine: Xavier
- Engine: Aurora
- Engine Comparison
Automation & Command Line
Architecture & Internals
- Architecture Overview
- Lifecycle
- Commandog Dispatcher
- Single-Instance Mutexes
- IPC
- Backgroundog Service
- Crash Reporting
- Update Internals
- Property Service
- Undo Internals
Data, Files & Diagnostics
Building & Contributing
- Building From Source
- Repository Layout
- Shared Item Projects
- Code Conventions
- Preprocessor Symbols
- Publish Pipeline
- Bundle Installer Internals
- Extending Sucrose
- Contributing
- Translating with Localizer
- Localization Coverage
- Security Policy
- Privacy & Telemetry
Help & Support