Refactor and enhance webview_cef plugin #199
Open
+1,853
−69,607
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Refactor and enhance webview_cef: Linux dialogs, init options, GPU toggle, Dart readiness fixes
Summary
This PR improves stability and usability across platforms with a focus on Linux. It adds native GTK file dialogs, exposes initialization options (userAgent, cachePath, persistence flags, enableGPU), fixes a Linux frame-id mismatch, hardens shutdown, and cleans up Dart code for stronger typing and null-safety. Build tooling on Linux now tolerates missing Debug CEF bundles by falling back to Release binaries. Documentation is updated accordingly.
Key changes
Dart
WebviewManager
.Native/C++
CefFrame::GetIdentifier()
to a consistentint64_t
before comparisons.CefShutdown
to avoid atexit teardowns and fatal asserts.Build/CMake (Linux)
DOWNLOAD_CEF_FLAVOR
option (standard
|minimal
) to control prebuilt size.libcef.so
and resources to enable Debug builds of the plugin.Initialization options
New runtime options (Dart
WebviewManager.initialize
→ native CEF settings):userAgent
: product string appended to the default UA.cachePath
: writable directory for on-disk cache and preferences.persistSessionCookies
: persist session cookies (requires non-emptycachePath
).persistUserPreferences
: persist user preferences (requires non-emptycachePath
).enableGPU
: toggle GPU acceleration (applies command-line switches accordingly).Documentation
Cross-platform notes
cachePath
,persistSessionCookies
, andenableGPU
are applied across platforms (subject to CEF constraints).persistUserPreferences
may depend on CEF build exposure; if unavailable on a platform, it’s ignored safely.Verification
Breaking changes
Migration
WebviewManager().initialize({...})
early in app startup if you want custom UA, persistent cache/cookies, or to enable GPU.Next steps (optional)