English | 简体中文
Developer guide for building and extending Voyager for Safari.
TIP
Looking to install? You can now download the pre-signed app directly from the latest release. Simply download the .dmg and follow the prompts to install.
# Install dependencies
bun install
# Build for Safari
bun run build:safari
This creates a dist_safari/ folder with the extension files.
# Convert to Safari format
xcrun safari-web-extension-converter dist_safari --macos-only --app-name "Gemini Voyager"
# Open in Xcode
open "Gemini Voyager/Gemini Voyager.xcodeproj"
In Xcode:
bun run dev:safari
This watches for file changes and rebuilds automatically. After each rebuild:
# After code changes
bun run build:safari
# Then rebuild in Xcode (⌘R)
This project includes Swift code for native macOS features. Adding it is optional but recommended.
safari/
├── App/
│ └── SafariWebExtensionHandler.swift # Native message handler
└── Models/
└── SafariMessage.swift # Message definitions
safari/App/ and safari/Models/Once added, you can:
From JavaScript:
// Health check
browser.runtime.sendNativeMessage({ action: 'ping' }, (response) => {
console.log(response); // { success: true, data: { status: "ok", message: "pong" } }
});
// Get version
browser.runtime.sendNativeMessage({ action: 'getVersion' }, (response) => {
console.log(response.data); // { version: "1.0.0", platform: "macOS" }
});
Available Actions:
ping - Health checkgetVersion - Get extension version infosyncStorage - Sync storage (placeholder for future)Web Console:
Native Logs:
log stream --predicate 'subsystem == "com.gemini-voyager.safari"' --level debug
"Module 'SafariServices' not found"
Native messaging not working
Info.plist has SafariWebExtensionHandler as principal classSwift files not compiling
Requires:
See Apple's official guide for details.
├── dist_safari/ # Built extension (gitignored)
├── safari/ # Native Swift code
│ ├── App/ # Extension handlers
│ ├── Models/ # Data models
│ └── Resources/ # Example code
├── src/ # Main extension source
└── vite.config.safari.ts # Safari build config
bun run build:safari # Production build
bun run dev:safari # Development with auto-reload
bun run build:all # Build for all browsers
By default, update reminders are disabled for Safari builds to avoid conflicts with App Store auto-updates.
To enable update reminders (for manual distribution):
ENABLE_SAFARI_UPDATE_CHECK=true bun run build:safari
Note: Only enable this if you're distributing the extension manually (not via App Store). App Store versions should use the default (disabled) to rely on automatic updates.
Due to Safari's technical architecture and security restrictions, the following features are currently unavailable in the Safari version:
See CONTRIBUTING.md for contribution guidelines.
When adding native features:
SafariMessage.swiftSafariWebExtensionHandler.swift