Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Sep 4, 2025

This PR implements a comprehensive Safari browser extension for TimeHarbor that enables one-click screenshot capture with flexible storage options. The extension supports three configurable storage modes to meet different user needs:

Key Features

Storage Modes

  • Local Only: Save screenshots locally with HTML activity log (no internet required)
  • Server Only: Upload directly to TimeHarbor server with offline queue fallback
  • Both (Hybrid): Save locally AND upload to server simultaneously

Core Functionality

  • One-Click Capture: Toolbar button and keyboard shortcut (⌘⇧H) for instant screenshot capture
  • HTML Activity Log: Self-contained browsable timeline interface showing all captures with search and filtering
  • Metadata Extraction: Captures URL, title, favicon, viewport info, and user agent
  • Offline Support: Queue system automatically syncs pending uploads when connection is restored
  • File System Integration: Structured local storage in ~/Documents/TimeHarbor/ with organized date folders

Technical Implementation

  • Safari App Extension: Native Swift handler for screenshot capture and file system access
  • Cross-Browser Architecture: Shared JavaScript modules designed for future Chrome extension support
  • Modern UI: Clean popup interface with mode selection and real-time status indicators
  • API Integration: Complete RESTful client with authentication and error handling
  • Settings Management: Comprehensive configuration interface for all extension options

File Structure

extension/
├── safari/                           # Safari App Extension
│   ├── TimeHarbor Extension.xcodeproj
│   ├── TimeHarbor Extension/
│   │   ├── SafariWebExtensionHandler.swift    # Native file operations
│   │   ├── Info.plist                         # Extension permissions
│   │   └── Resources/                         # Web extension files
├── shared/                           # Cross-browser JavaScript modules
│   ├── storage-manager.js           # Three-mode storage system
│   ├── html-log-generator.js        # Activity log creation
│   ├── api-client.js               # Server communication
│   └── screenshot-handler.js       # Capture functionality
├── templates/                       # HTML interfaces
│   ├── activity-log.html           # Browsable timeline view
│   └── settings.html               # Configuration interface
└── docs/                           # Documentation
    ├── API.md                      # Server integration spec
    └── INSTALLATION.md             # Setup and development guide

Usage Example

  1. Install Extension: Build and run the Xcode project to load the Safari extension
  2. Configure Mode: Select storage preference (Local/Server/Both) in the popup interface
  3. Capture Screenshots: Click toolbar button or use ⌘⇧H on any webpage
  4. View Activity: Access the HTML activity log to browse all captured screenshots

Server Integration

For server and hybrid modes, the extension communicates with TimeHarbor's API endpoints for authentication, upload, and synchronization. Complete API documentation is included for server-side implementation.

Development Features

  • Native Messaging: Bridge between JavaScript and macOS file system
  • Error Handling: Comprehensive error management with user feedback
  • Extensible Design: Architecture supports future Chrome extension implementation
  • Modern Development: Uses current Safari App Extension and Web Extension standards

This implementation provides a solid foundation for Phase 1 MVP requirements and can be extended with additional features like bulk operations, advanced filtering, and cross-platform support.

Fixes #56.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copy link
Contributor Author

Copilot AI commented Sep 4, 2025

@horner 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs.

I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review.

Copilot AI and others added 2 commits September 4, 2025 05:55
Co-authored-by: horner <6094599+horner@users.noreply.github.com>
…ocumentation

Co-authored-by: horner <6094599+horner@users.noreply.github.com>
Copilot AI changed the title [WIP] TimeHarbor Browser Extension Development Ticket Implement TimeHarbor Browser Extension with Safari Support and Configurable Storage Modes Sep 4, 2025
Copilot AI requested a review from horner September 4, 2025 06:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

TimeHarbor Browser Extension Development Ticket

2 participants