惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

腾讯CDC
Microsoft Azure Blog
Microsoft Azure Blog
L
LangChain Blog
Y
Y Combinator Blog
Microsoft Security Blog
Microsoft Security Blog
宝玉的分享
宝玉的分享
B
Blog RSS Feed
MongoDB | Blog
MongoDB | Blog
Jina AI
Jina AI
D
Docker
B
Blog
Engineering at Meta
Engineering at Meta
Last Week in AI
Last Week in AI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
I
InfoQ
G
Google Developers Blog
博客园 - Franky
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
The GitHub Blog
The GitHub Blog
T
The Blog of Author Tim Ferriss
大猫的无限游戏
大猫的无限游戏
阮一峰的网络日志
阮一峰的网络日志
U
Unit 42

Hacker News: Show HN

PurrrrrFocus: Pomodoro Timer App - App Store Workflow Engine — Multi-Step Orchestration for Bun RapidPhoto: Pro Photo Editor App - App Store GitHub - DheerG/swarms: Achieve extraordinary results with claude code across a variety of tasks SPICE simulation → oscilloscope → verification with Claude Code — Lucas Gerads Show HN: VCoding – A 5 MB native Windows IDE with no dynamic dependencies Show HN: LLMs don't hallucinate because they're bad at math, it's the format GitHub - Agent-FM/agentfm-core: AgentFM is a peer-to-peer network that turns everyday computers into a decentralized AI supercomputer. AgentFM lets you run massive AI workloads directly across a global mesh of idle CPUs and GPUs. Show HN: Tracking Top US Science Olympiad Alumni over Last 25 Years GitHub - Potarix/agent-hub: One place to talk to all your agents Show HN: Runtime security for AI agents(injection,tool abuse, data exfiltration) GitHub - dubeyKartikay/lazyspotify: Terminal Spotify client for macOS and Linux GitHub - the-banana-tool/king-louie: Easy to use GUI Personal AI Assistant. Win/Linux/Mac. Show HN I made my vacation rental bookable by AI agents–no Airbnb, 0% commission GitHub - basteez/jsf-autoreload: maven plugin to enable hot reload on jsf projects uvm32/hosts/host-gdbstub at main · ringtailsoftware/uvm32 GitHub - labsai/EDDI: Config-driven engine that turns JSON into production-grade AI agents. Multi-agent orchestration, 12+ LLM providers, MCP/A2A protocols, RAG, persistent memory, and enterprise compliance (EU AI Act, GDPR, HIPAA). Built on Quarkus. GitHub - glitchnsec/fortyone-oss: AI Executive Assistant Platform Quickstart | Alien GitHub - muxshed/shed: One stream in, or many. Every destination, simultaneously. No cloud middleman, no per-channel fees, no limits. GitHub - ocrbase-hq/ocrbase: 📄 PDF/IMG ->.MD/JSON Document OCR API for PaddleOCR and GLMOCR. Self-hostable. GitHub - impactjo/home-memory: MCP server that lets your AI assistant remember everything about your home. GitHub - Sets88/dbcls: DbCls is a powerful terminal database client that supports various databases GitHub - neptun2000/heor-agent-mcp GitHub - SeanFDZ/macmind: Single-layer transformer in HyperTalk for the classic Macintosh RollQuation: Math Puzzles - Apps on Google Play GitHub - dropbox/witchcraft Show HN: Agent-cache – Multi-tier LLM/tool/session caching for Valkey and Redis GitHub - opentalon/opentalon: OpenTalon is an open-source platform built from the ground up in Go as a robust alternative to OpenClaw LinkedIn™ 职位抓取工具 - Chrome 应用商店
GitHub - Rajaniraiyn/CefSwift: Chromium Embedded Framewor...
rajaniraiyn · 2026-06-15 · via Hacker News: Show HN

Chromium Embedded Framework for SwiftUI apps on macOS.

Why

  • Embed real Chromium (not WKWebView) in a SwiftUI app with a single view.
  • Three hosting modes: a windowed native browser, a Chrome-runtime window with tabs and chrome:// pages, and an offscreen Metal-backed view for mixing web content into custom layouts.
  • A SwiftPM command plugin downloads the pinned CEF distribution and assembles a signed .app with the five helper bundles. No Xcode required.

Install

dependencies: [
    .package(url: "https://github.com/Rajaniraiyn/CefSwift.git", from: "0.1.0")
],
targets: [
    .executableTarget(
        name: "MyApp",
        dependencies: [.product(name: "CefSwiftUI", package: "CefSwift")]
    )
]

Quick start

import SwiftUI
import CefSwiftUI

@main
struct MyApp: CefSwiftApp {
    var body: some Scene {
        WindowGroup {
            CefWebView(url: URL(string: "https://example.com")!)
        }
    }
}

Build a runnable .app (CEF can't run from a bare executable):

swift package --allow-writing-to-package-directory \
              --allow-network-connections all \
              cef bundle --product MyApp

Hosting modes

View Backing Use for
CefWebView Native NSView, Alloy runtime Embedded web content in a SwiftUI layout
CefChromeWindow Chrome runtime window Tabs, extensions, chrome:// pages — full browser UI
CefMetalWebView Offscreen render, IOSurfaceCALayer Custom compositing, transforms, mixing into Metal scenes

Examples

The Examples/ directory is a standalone package with three apps:

Browser Browser — Arc-style tabbed browser on the Chrome runtime: omnibox, popups, DevTools, chrome://.
Gallery Gallery — embedded CefWebView cards mixed with native SwiftUI controls.
Launcher Launcher — one app to try every hosting mode and config; click a row, launch its window.

Inside the Launcher

Hosting mode What you see
Windowed Alloy CefWebView — CEF renders into a child NSView (max compatibility).
Chrome Window CefChromeWindow — full Chrome runtime, SwiftUI toolbar inline with traffic lights.
OSR / Metal CefMetalWebView — offscreen → IOSurfaceCALayer. Composite native UI over web pixels.
JS Bridge bridge.register / window.cefSwift.invoke — typed Codable round-trips.
Popups & Tabs target=_blank / window.open / ⌘-click routed by the window-open handler.

Run any of them:

swift package --package-path Examples \
              --allow-writing-to-package-directory \
              --allow-network-connections all \
              cef bundle --product Launcher
open Examples/dist/Launcher.app

Status

macOS only. Requires macOS 14+, Swift 6, and a CEF 148+ distribution (downloaded automatically by the plugin, pinned in CEF_VERSION.json, refreshed by a scheduled workflow). Apple silicon and Intel.

Current limitations: no native V8 window.foo binding (bridge goes through the cefswift:// scheme); accessibility-tree bridging for OSR is enablement-only (no NSAccessibility surface yet).

JS ↔ Swift bridge

Register Swift functions and call them from page JavaScript as typed promises. Inputs/outputs are Codable; handlers are async and run off the main thread.

// Swift
CefRuntime.shared.bridge.register("greet") { (name: String) in
    "Hello, \(name)"
}
// JS — window.cefSwift is auto-injected at load-end while any handler is registered
const reply = await window.cefSwift.invoke('greet', 'World');

Push events the other way with CefRuntime.shared.bridge.broadcast(event: "tick", data: [...]) — pages subscribe via window.cefSwift.on('tick', fn).

Full reference (typed vs raw handlers, shim auto-injection, transport, security guidance): docs/configuration.md — JS ↔ Swift bridge.

Sandbox

The Chromium macOS sandbox is wired end-to-end. Off by default for ad-hoc dev builds; flip config.noSandbox = false to enable it in a properly signed bundle. See docs/sandbox.md.

Documentation

See docs/ for architecture (hosting modes, OSR/Metal, threading), bundling, configuration (JS bridge, links/popups, context menus), sandboxing, and the auto-update pipeline.

License

BSD 3-Clause. See LICENSE. The Chromium Embedded Framework is a separate work under the same license; ship its license alongside your app.


Made with ❤️ by Rajaniraiyn