How btbishop93/braver-search works
• Browser Environment: Represent Safari (on iOS/macOS) where the extension runs.
• Extension Core:
• Background Script (“background.js” in Shared (Extension))
• Popup Interface Components (“popup.html”, “popup.css”, “popup.js”)
• Native Integration:
• SafariWebExtensionHandler.swift that bridges the extension’s functionalities into native code.
• Host Applications:
• iOS App (in “iOS (App)” and “iOS (Extension)” directories)
• macOS App (in “macOS (App)” and “macOS (Extension)” directories)
• Shared Codebases:
• Shared (App) for common application logic.
• Shared (Extension) for common extension resources and functionality.
• Supporting Layers:
• Tests (unit tests and integration tests in the Tests directory for JavaScript and native code)
• CI/CD Workflow using GitHub Actions (shown as external deployment pipelines and integration systems that handle code signing, building, and deployment)
Relationships and Interactions
• From Safari’s web navigation events (originating in the browser environment) to the background script that intercepts and redirects search queries.
• Native bridge (SafariWebExtensionHandler.swift) connecting the Web Extension to the iOS/macOS native layer.
• Interactions for:
• Code Signing, provisioning profiles, and deployment pipelines (GitHub Actions) which ensure the app/app extension is built and distributed correctly.
• Communication from the host applications (iOS/macOS) to the shared app logic supporting the extension and vice versa.
Architectural Patterns
• Modularity: The separation of “App” and “Extension” code into platform-specific and shared directories.
• Event-driven handling: The background script monitors and intercepts browser events.
• Native integration: A dedicated bridge (SafariWebExtensionHandler) ensures the extension is tightly integrated with Safari.
• CI/CD automation: GitHub Actions workflows handle automated building, signing, and deployment steps.
Technical Details and Technologies
• Xcode project elements (e.g., project.pbxproj and scheme files) indicate a reliance on Xcode for building and a manual code signing setup.
• Technologies: JavaScript (for the extension’s core logic and popup UI), Swift (for iOS/macOS native integration), CSS/HTML for the popup interface.
• Deployment details: Certificates, provisioning profiles, and App Store Connect API keys are managed via CI/CD (GitHub Actions), so include that in a separate “deployment pipeline” section if desired.