Skip to content

Sumon-Kayal/Bookmark-Sync-Offline

Repository files navigation

πŸ”– Bookmark Sync Offline

A lightweight browser extension for transferring bookmarks between Chromium-based browsers and Firefox on Android β€” export from one, import into another, with local storage as the bridge.

License Version JavaScript

🎯 Purpose

This extension is designed to transfer bookmarks between:

  • 🟠 Chromium-based Android browsers that support extensions (e.g. Cromite, Kiwi)
  • 🦊 Firefox for Android β€” including its forks that support browser extensions

πŸ’‘ Why Firefox for Android? Firefox for Android and its forks do not have a built-in bookmark export feature. This extension fills that gap β€” letting you export your bookmarks as JSON or HTML directly from the browser.


πŸ“± Screenshot

Bookmark Sync popup running on Android in Cromite, showing staged bookmarks with Pull from Browser, Push to Browser, Import File, Export JSON, Export HTML and Clear Staging Area buttons

✨ Features

  • πŸ”„ Cross-Browser Transfer - Move bookmarks between Chromium browsers and Firefox (including Android forks)
  • πŸ“‘ Change Detection - Background listener detects bookmark changes and notifies the popup in real time
  • πŸ“Š Staging Area - Review and manage bookmarks before pushing them to the browser
  • 🎯 Lightweight - Minimal resource usage with fast performance
  • πŸ”’ Privacy Focused - All data stored locally, no server or account required
  • 🎨 Modern UI - Clean and user-friendly interface

πŸš€ Installation

πŸ’» From Source (Development)

  1. Clone the repository

    git clone https://github.com/Sumon-Kayal/Bookmark-Sync-Offline.git
    cd Bookmark-Sync-Offline
  2. Load in Chrome/Edge

    • Open chrome://extensions/ (or edge://extensions/)
    • Enable "Developer mode" (toggle in top-right corner)
    • Click "Load unpacked"
    • Select the Bookmark-Sync-Offline folder
  3. Load in Firefox

    • Open about:debugging#/runtime/this-firefox
    • Click "Load Temporary Add-on"
    • Select any file from the Bookmark-Sync-Offline folder (e.g., manifest.json)

πŸ“– Usage

⚑ Basic Operations

  1. Initial Sync

    • Click the extension icon in your browser toolbar
    • Click "Pull from Browser" to save all your bookmarks to the staging area
    • The count display will update to show how many bookmarks were staged
  2. Import Bookmarks

    • Click "Import File" to open the import page, then use the file picker to load bookmarks from a JSON or HTML file
    • Once imported, click "Push to Browser" to add them to your browser
  3. Automatic Sync

    • The extension automatically syncs when you:
      • Add new bookmarks
      • Delete bookmarks
      • Move bookmarks between folders
      • Rename bookmarks or folders

πŸ—‚οΈ Features Overview

  • Popup Interface: Quick access to pull, push, export, and import bookmarks
  • Import File Page: Full-page interface for importing bookmarks from JSON or HTML files
  • Change Detection: Background listener that detects bookmark changes and notifies the popup
  • Storage Statistics: View how many bookmarks are staged

πŸ› οΈ Development Setup

πŸ“‹ Prerequisites

  • Modern web browser (Chrome 140+, Firefox 140+, or Edge 140+)
  • Basic knowledge of JavaScript and browser extensions
  • Text editor or IDE (VS Code recommended)

πŸ“ Project Structure

Bookmark-Sync-Offline/
β”œβ”€β”€ manifest.json          # Extension manifest
β”œβ”€β”€ background.js          # Background service worker
β”œβ”€β”€ popup.html            # Extension popup interface
β”œβ”€β”€ popup.js              # Popup functionality
β”œβ”€β”€ manager.html          # Bookmark import page
β”œβ”€β”€ styles.css            # Shared styles
β”œβ”€β”€ README.md             # This file
β”œβ”€β”€ CHANGELOG.md          # Version history
β”œβ”€β”€ SETUP.md              # Setup and icon documentation
β”œβ”€β”€ LICENSE               # GPL-3.0 License
└── .gitignore           # Git ignore rules

πŸ—οΈ Key Files

  • manifest.json - Defines extension properties, permissions, and scripts
  • background.js - Handles bookmark events and synchronization logic
  • popup.js - Controls the popup interface and user interactions
  • manager.html - Full-page bookmark import interface (file picker and drag-and-drop)

πŸ” Development Workflow

  1. Make Changes

    # Edit files in your preferred editor
    code .
  2. Reload Extension

    • Chrome/Edge: Go to chrome://extensions/ and click the reload icon
    • Firefox: Click "Reload" on about:debugging
  3. Test Features

    • Test bookmark creation, deletion, and modification
    • Verify sync functionality
    • Check manager interface
    • Test error handling
  4. Debug

    • Right-click extension icon β†’ "Inspect popup" (for popup debugging)
    • Go to chrome://extensions/ β†’ "Inspect views: service worker" (for background script)
    • Check browser console for errors

πŸ§ͺ Testing

βœ… Manual Testing Checklist

  • Extension installs without errors
  • Popup opens and displays correctly
  • Initial sync saves all bookmarks
  • New bookmarks are automatically detected
  • Bookmark manager opens correctly via Import File button
  • JSON and HTML import works correctly
  • Export JSON and Export HTML produce valid files
  • Push to Browser adds bookmarks without duplicates
  • Clear Staging Area wipes only extension storage
  • Extension icon displays properly

🌐 Browser Compatibility

Browser Version Status
Chrome 140+ βœ… Supported
Edge 140+ βœ… Supported
Other Chromium-based Android browsers with extension support 140+ βœ… Supported
Firefox & its Android forks 140+ ❌ Currently Not working
Safari - ❌ Not tested
Opera 74+ ⚠️ Desktop only (no extension support on Android)

πŸ“ API Reference

πŸ—ƒοΈ Storage Structure

// Bookmarks are stored in chrome.storage.local
{
  "bookmarks_data": {
    "data": [
      {
        "title": "Example Site",
        "url": "https://example.com",
        "dateAdded": 1234567890000
      }
    ],
    "savedAt": 1234567890000,
    "count": 1
  }
}

βš™οΈ Key Functions

background.js

  • initializeExtension() β€” Sets default metadata on first install
  • setupAlarms() β€” Creates the 24h maintenance alarm (clears first to avoid duplicates)
  • performMaintenance() β€” Runs periodic storage housekeeping
  • debounceNotifyPopup(message) β€” Alarm-based debounce for bookmark change notifications

popup.js

  • handlePull() β€” Reads the full bookmark tree and saves to local storage
  • handlePush() β€” Pushes staged bookmarks into the browser's bookmark bar
  • handleExportJson() / handleExportHtml() β€” Exports stored bookmarks to file
  • handleImportFileData(file) β€” Imports bookmarks from a JSON or HTML file
  • findOrCreateFolder(title) β€” Finds or creates a folder on the bookmarks bar

🀝 Contributing

Contributions are welcome! Here's how you can help:

  1. Fork the repository
  2. Create a feature branch
    git checkout -b feature/amazing-feature
  3. Commit your changes
    git commit -m 'Add some amazing feature'
  4. Push to the branch
    git push origin feature/amazing-feature
  5. Open a Pull Request

πŸ“ Contribution Guidelines

  • Follow existing code style
  • Add comments for complex logic
  • Test thoroughly before submitting
  • Update documentation as needed
  • Keep commits focused and descriptive

πŸ› Known Issues

  • None currently reported

πŸ“‹ Roadmap

  • Search functionality in manager
  • Cloud sync integration
  • Tag system for bookmarks
  • Keyboard shortcuts
  • Dark mode support
  • Bookmark statistics and analytics
  • Duplicate detection
  • Backup scheduling

πŸ“„ License

This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.

πŸ‘€ Author

Sumon Kayal

πŸ™ Acknowledgments

  • Thanks to all contributors
  • Inspired by the need for better bookmark management
  • Built with modern web extension APIs

πŸ“ž Support

If you encounter any issues or have questions:

  • Open an Issue
  • Check existing issues for solutions
  • Star the repository if you find it useful!

πŸ”— Links

πŸ“‹ Changelog


Made with ❀️ by Sumon Kayal

About

An browser extension that sync bookmarks from browser to internal storage

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors