flutter_chromium_webview 0.5.10
flutter_chromium_webview: ^0.5.10 copied to clipboard
Chromium webview for Windows, macOS and Linux using CEF textures, and Android using the system WebView, with browser events and origin-restricted channels.
0.5.10 #
- Native (Windows, Linux & macOS): cache and reuse named persistent
CefRequestContextinstances (profileName) for the lifetime of the CEF runtime (NamedProfileContextCache/AcquireContext) and release them cleanly beforeCefShutdown(). This prevents WindowsERROR_SHARING_VIOLATION/ Chromium"Profile error occurred — Your preferences can not be read"dialogs caused by tearing down and immediately reopening the same on-disk profile directory across browser close/recreate cycles. - Native (Windows, Linux & macOS): make
AllowAutoplayidempotent viaGetPreferencechecks beforeSetPreferenceso already-configured profiles do not needlessly rewritePreferenceson disk on every browser creation.
0.5.9 #
- Linux: add
WindowVisibilityStatecombining GTK3window-state-event(GDK_WINDOW_STATE_ICONIFIED,GDK_WINDOW_STATE_WITHDRAWN,GDK_WINDOW_STATE_FOCUSED),visibility-notify-event(GDK_VISIBILITY_FULLY_OBSCURED/GDK_VISIBILITY_PARTIAL/GDK_VISIBILITY_UNOBSCURED), andmap/unmapsignals so minimizing, switching workspaces, or fully obscuring an unfocused toplevel on GNOME Wayland (Mutter) suspends off-screen CEF rendering (SetWindowlessFrameRate(1)+OnPaintgating) without relying solely onGDK_WINDOW_STATE_ICONIFIED. - Linux: explicitly enable
GDK_VISIBILITY_NOTIFY_MASK | GDK_STRUCTURE_MASKon the top-levelGtkWindowand its realizedGdkWindowwhile preserving active rendering for visible unfocused side-by-side windows, guarding focused windows against stale obscure notifications, and keeping background audio, cookies, playback position, and last-frame texture restoration intact. - Linux: preserve X11
GDK_WINDOW_STATE_ICONIFIEDminimize/restore semantics and exposewindowIconified,windowFullyObscured,windowMapped, andwindowFocusedalongsidewindowMinimizedingetDiagnostics. - Linux: add 5 native
WindowVisibilityStateGoogleTest cases covering X11 iconify/restore, WaylandGDK_VISIBILITY_FULLY_OBSCUREDsuspension/restore, focused-window stale-obscure guarding, unmap/withdrawn transitions, Hide/Show orthogonality, and clean exit while suspended.
0.5.8 #
- Linux: implement
ChromiumWebViewController.setRenderingActive(bool)and automatic GTK window-minimization (GDK_WINDOW_STATE_ICONIFIED) rendering suspension inCefBrowserHandlerandFlutterChromiumWebviewPlugin. - Linux: throttle off-screen CEF compositing from
60 FPSto1 FPSviaSetWindowlessFrameRate(1)without callingWasHidden(true)sodocument.visibilityStateremains'visible', preserving background audio playback, JavaScript timers, browser identity, and playback position. - Linux: gate
OnPaintBGRA→RGBA conversion and Flutter texture notifications while suspended while keeping the last validfront_bufferintact so rapid Hide/Show and minimize/restore transitions recover cleanly without black-frame flashes; triggerInvalidate(PET_VIEW)immediately when rendering resumes. - Linux: expose
windowMinimized,renderingSuspendedBrowsers,publishedFrames, andsuppressedFramesingetDiagnostics, and add 3 native GoogleTest suites (CefBrowserHandlerRenderingSuspension) covering active/suppressedOnPaint, independent GTK minimize composition, and 100 rapid Hide/Show + minimize cycles.
0.5.7 #
- Dart: add
ChromiumWebViewController.setRenderingActive(bool)to throttle desktop off-screen rendering (60 FPS → 1 FPS) when visual updates are paused or minimized without suspending audio or JavaScript bridge callbacks (implemented on Windows and macOS; graceful no-op fallback on Linux and Android). - Dart: disable the 1-second
DebugHeartbeatJavaScript timer by default inChromiumYoutubePlayerController(opt-in viaenableDebugHeartbeat: true), track and clear all JS interval timers onpagehide,beforeunload, reload, and disposal, and gate diagnostic logging to debug mode. - Dart: reject pending and new
ChromiumYoutubePlayerControllercommands immediately on browser detachment/disposal instead of waiting for the 5-secondcommandTimeout, fail pendingevaluateJavaScriptfutures immediately on crash/detachment/disposal, deduplicate crash notifications per browser generation, and bound consecutive automatic crash recovery attempts (maxAutoRecoveryAttempts = 3). - Native (Windows, macOS & Linux): persist named browser profiles (
profileName) across full application restarts under<root_cache_path>/profile_<name>with strict[a-zA-Z0-9_]validation preventing path traversal, flush cookie stores on browser close, keep anonymous (profileName: null) contexts isolated, and safely handle controller disposal during asynchronousCefRequestContextinitialization (ContextReadyHandler). - Android: emit
browserCrash(instead ofloadError) fromonRenderProcessGonewith duplicate-notification guard, unregisterApplication.ActivityLifecycleCallbackson both Activity detach and engine teardown while preventing duplicate registrations across configuration changes, and remove unconditional ReleaseChromiumBGlogging and commented experimental code. - Windows: replace the fixed 10 ms
SetTimerCEF polling loop with CEF's event-drivenexternal_message_pump(OnScheduleMessagePumpWorkvia a hiddenHWND_MESSAGEwindow), lowering idle CPU and eliminating unnecessary wakeups while preserving Win32 main-thread affinity and clean shutdown. - Windows: optimize
FlutterChromiumTexturewith a bounded reusable frame buffer pool (eliminating per-frame 8+ MB allocations in steady state), runtime-detected SSSE3/SSE2 SIMD BGRA→RGBA conversion, and explicit buffer release (Clear()) on popup hide, window minimization, and browser close. - macOS: forward caller-provided
cachePathfromChromiumWebViewController.initialize()throughChromiumHostManager(--cache-path=...) toChromiumWebViewHostwith symlink resolution and safe PID-scoped fallback when omitted, enabling cross-restart persistent named profiles; preservecachePathandkeychainBehavioracross host crash restarts. - macOS: wire
setRenderingActive(bool)over IPC toHostBrowserClient::SetRenderingActive, wrap asynchronous browser creation in@autoreleasepool, guard prematureIOSurfaceallocation on resize, retain only the active sourceMTLTexturealongside the 3-slot destination ring, retry transientECONNREFUSED/ENOENTwhile the host socket enterslisten(), and includeNativeUi.mminmacos/Host/build_host.sh. - Windows & Linux: implement
CefRequestHandler::OnRenderProcessTerminated(deduplicated) so renderer crashes reliably emitbrowserCrashevents to Dart across all supported platforms; deduplicateOnRenderProcessTerminatedon macOS. - Linux: add explicit, container-verified inner-sandbox opt-out (
FLUTTER_CHROMIUM_WEBVIEW_ALLOW_CONTAINER_NO_SANDBOX=1restricted strictly to verified Snap or Flatpak confinement; ordinary Linux.deb/AppImage/desktop hosts always retain Chromium's native sandbox) with GoogleTest security-matrix unit tests, plus opt-inFLUTTER_CHROMIUM_WEBVIEW_PASSWORD_STOREselection for headless/CI testing. - Linux: harden the MTML shutdown state machine with an 8-state lifecycle,
TID_UIsynchronization barrier, bounded GLib context drain, and 8 failure-injection GoogleTest cases. - Windows, macOS & Linux: unify the validated opt-out low-memory Chromium feature profile (
FLUTTER_CHROMIUM_WEBVIEW_LOW_MEMORY=0to revert) andCEF_SYSTEM_MEDIA_CONTROLS=0duplicate media-session suppression via a shared native flags helper, and gate macOS Release per-IPC/per-frameNSLogandMedia.enableDevTools attachment behind#if DEBUG.
0.5.6 #
- Linux: refactor CEF lifecycle to
multi_threaded_message_loop = true(CEF 149.0.4), eliminating the 100% idle CPU spin (issue #12), removingCefRunMessageLoop()re-entrySIGTRAPcrashes, and requiring zero globalGApplicationsymbol interposition. Isolated idle main-thread CPU drops from ~99.9% to0.0–0.2%(0.9%full process tree on static idle page), and active navigation GTK main-thread CPU drops by ~47% (8.38% → 4.41%). - Linux: enforce strict GTK main-thread vs CEF
TID_UIthread affinity across browser creation, input/IME (CefKeyboard), dialogs, context menus, texture registration, coalescedOnPaintnotifications, and condition-variable +TID_UIbarrier shutdown across multi-window,g_application_hold()window reopen, and directg_application_quit()flows. - Linux: fix
libflutter_chromium_webview_plugin.soINSTALL_RPATHto$ORIGINso release bundles never embed absolute build-directory paths. - Linux: reduce runtime memory footprint without disabling sandboxing or site isolation by disabling speculative spare renderers (
SpareRendererForSitePerProcess) and unused desktop Chrome background services (opt-out viaFLUTTER_CHROMIUM_WEBVIEW_LOW_MEMORY=0), eliminating redundant frame copies andretired_buffersretention inFlutterChromiumTexture, releasing popup/browser buffers viaflutter_chromium_texture_clear, callingWasHidden(true)on close, and invokingmalloc_trim(0)onTID_UIinOnBeforeClose. - Dart: handle
PlatformException(DETACHED)cleanly inChromiumWebViewControllerduring host view detachment without swallowing unrelated errors, cancel periodic JS bridge timers on app exit/detach in the example app, and add lifecycle unit tests covering disposal during JS execution, double disposal, detachment during navigation, closing during initialization, multi-controller disposal, and late native callbacks. - Tooling: add Linux lifecycle, stress/compatibility, CPU, and 12-scenario memory benchmark scripts (
scripts/test_linux_lifecycle.sh,scripts/test_linux_stress_and_compat.sh,scripts/benchmark_linux_cpu.sh,scripts/benchmark_linux_memory.sh,scripts/check_linux_idle_cpu.sh) and Flutter 3.50 analyzer compatibility inscripts/validate_linux.sh.
0.5.5 #
- Allow macOS hosts with native media controls to disable Chromium's duplicate system media session with
CEF_SYSTEM_MEDIA_CONTROLS=0. - Find Homebrew and CMake.app installations when building from Xcode's restricted PATH; clarify missing CMake errors.
- Mark CEF preparation as intentionally running on every build.
- Support host-coordinated YouTube crash recovery and expose video playback quality diagnostics.
- Preserve Android autoplay media playback when its Activity is minimized.
- Bound the Metal texture cache to one source and three destinations, clean it up on resize/disposal, and drain paint autorelease pools.
- Allow macOS termination to finish after Flutter's asynchronous exit response.
0.5.4 #
- Add configurable
keychainBehaviorparameter (ChromiumKeychainBehavior.mockvs.system) toChromiumWebViewController.initialize. - Default to mock keychain on macOS to prevent unnecessary login keychain access prompts.
- Support
CEF_KEYCHAIN_BEHAVIORenvironment variable override (mockorsystem). - Require
flutter_chromium_webview_platform_interface^0.1.7.
0.5.3 #
-
Separate deterministic macOS core/local media RSS validation from explicitly invoked live YouTube reporting; preserve strict memory assertions and external blocked verdicts.
-
Gate platform-interface publication on its API/example checks and consumer compatibility, independently of native/live services.
-
Require platform interface 0.1.6, which publishes the JavaScript evaluation/cancellation, click-count and browser-crash APIs used by this plugin.
-
Fix macOS Chromium host embedding and preserve native startup/failure diagnostics.
-
Recover macOS browsers after renderer or GPU-process crashes through the existing browser recreation contract; arbitrary page state is not preserved.
-
Improve macOS playback telemetry and independent validation-stage reporting.
-
Preserve Android integration startup and crash diagnostics.
-
Refresh installation, runnable examples, macOS setup and release documentation; correct the iOS support claim because the release pubspec does not register that backend.
-
Exclude monorepo dependency overrides from publication and keep the bundled example's published dependency resolution independent of sibling checkouts.
-
Document remaining macOS memory limits: proposed 8 GB support is unverified, historical strict RSS acceptance remains failed, and long-term memory boundedness is not established. No allocator fix or relaxed memory threshold is included.
0.5.2 #
- Fix JavaScript mocked player properties in integration test.
- Prevent git tracking of temporary and machine-specific profiling artifacts.
0.5.1 #
- Complete public API documentation audit. Documented all public classes, methods, and fields.
- Resolve analyzer warnings and info-level lints.
- Exclude large binary artifacts from publication to comply with package size limits.
0.5.0 #
- Add macOS CEF and YouTube playlist support.
- Fix macOS architecture configuration and linking issues.
- Require the latest platform interface version.
0.3.1 #
- Correct Linux pointer coordinates at fractional and high device pixel ratios.
- Require the platform interface version that includes named browser profiles.
- Fix automated publication authentication and validate release tag versions.
0.3.0 #
- Add macOS support using native CEF framework.
- Add iOS support using a headless WKWebView implementation.
- Add Android API 24+ support through the system Chromium WebView and a native Flutter platform view.
- Preserve browser identity when attaching a view without a desktop texture.
- Add emulator validation for browser lifecycle, origin-restricted channels, HTML and playback settings.
- Keep WSL validation in a separate Linux checkout to protect Windows build metadata.
0.2.1 #
- Fix Windows packaging, stabilize integration tests and update version status.
0.2.0 #
- Add Windows (x64) backend support.
- Provide full integration with CEF sandboxed runner for Windows.
0.1.1 #
- Fix platform interface class exports for pub release.
0.1.0 #
- Initial release.
- Chromium Embedded Framework web view for Flutter desktop using off-screen rendering and Flutter textures.
- Experimental Linux x64 support: navigation, JavaScript execution and channels, mouse and keyboard input, resizing, popups, dialogs and context menus.
ChromiumWebViewaccepts an optionalinitialUrl.- Talks to native code through
flutter_chromium_webview_platform_interface.