Skip to content

CefSwift 0.3.0

Latest

Choose a tag to compare

@github-actions github-actions released this 29 Nov 20:38
· 6 commits to main since this release
v0.3.0
e2c28ad
  1. Update your Swift package to CefSwift 0.3.0 (.upToNextMinor(from: "0.3.0")).
  2. Rebuild your app bundle. To play system codecs, list the systemMediaDecoders capability so cef bundle embeds the media service. Bundling guide
  3. If you take in-process screenshots of a window (CGWindowListCreateImage), they no longer show windowed pages: Chromium now draws those from its GPU process. Use ScreenCaptureKit on your own window instead.

Still CEF 158.0.6 with Chromium 158.0.8127.89, now on CEF API version 15800.

Behavior changes

  • Chromium's message loop is the default, in Chrome's arrangement: -[CefApplication run] runs Chromium's loop, which runs NSApp.run. .external remains as an opt-out.
  • Windowed pages are presented through Chromium's remote Core Animation API, as Chrome does. The GPU process uses about half the memory it did.
  • V8's limit-based memory reducer is on, as in Chrome. List V8Flag_memory_reducer_limit_based in disabledFeatures to undo it.

Measurements against Chrome for Testing are in design notes.

New

  • Start an app: swift package cef new <Name> (or Scripts/new-app.sh) generates a browser, app or minimal package, with --xcode for an Xcode project.
  • Media: AAC, ALAC and Dolby audio, and H.264 and HEVC video, through VideoToolbox in a sandboxed media service. Optional CefProtectedMedia (experimental) plays FairPlay audio for allowlisted origins.
  • Input: page.send(_:) with mouse, keyboard, wheel and gesture events for every kind of page, plus click(at:), typeText(_:), press(_:modifiers:) and scroll(at:by:).
  • DevTools Protocol: typed commands and events (CefDevToolsCommand, CefDevToolsEvent) on page.devTools.
  • Requests: .rewriteResponse(_:) rewrites a response body before the page sees it.
  • Profiles: clearSiteData(for:types:) deletes one site's data.
  • CefChromium services: zoom levels, search engines, browsing data, passwords, capture devices, protocol handlers, autofill addresses, fonts and languages, and tab lifecycle (CefTabLifecycle).
  • Extensions: finds native messaging hosts installed for Google Chrome and Chromium.
  • Bundling: fetches and embeds only the CEF architectures a build targets; signs framework helpers such as Sparkle's (see Examples/SparkleUpdates).
  • Everything builds with the Command Line Tools alone; Xcode is optional.

Fixes

  • No white bars along the edges while a window or animation resizes a windowed page.
  • Windowed pages close at once; a closing page no longer crashes lifecycle updates.

Also

Requires macOS 14 or later and Swift 6. The examples require macOS 15 or later.

Full changelog