Skip to content

Architecture

src/main.zig creates a webview and loads Discord:

const w = try Webview.create(true, null);
try w.setTitle("Tinycord");
try w.setSize(800, 600, .none);
try w.navigate("https://discord.com/app");
try w.run();

zig-webview abstracts the platform engine:

PlatformEngine
LinuxWebKitGTK
macOSWKWebView
WindowsWebView2

src/macos/media.m auto-grants camera and microphone access using Objective-C runtime APIs. Also sets a Chrome 131 user agent for Discord compatibility. Compiled only on macOS:

if (target.result.os.tag == .macos) {
exe.root_module.addCSourceFile(.{
.file = b.path("src/macos/media.m"),
.flags = &.{"-fobjc-arc"},
});
exe.root_module.linkFramework("CoreFoundation", .{});
}
DependencyRole
zig-webviewCross-platform WebView bindings