Skip to content

Repository files navigation

Syncr

Discord Rich Presence for Firefox. Syncr mirrors your web activity directly onto your Discord profile. Watch YouTube, listen to YouTube Music, browse Reddit, check Proton Mail, or watch Netflix, and your status updates in real time with artwork, progress bars, and source links.

  • Zero Cloud Servers: All communication occurs locally between Firefox and your desktop Discord client.
  • Privacy First: No Discord login required. Granular per-site toggles allow you to choose exactly what to share, and sensitive sites like Proton Mail use generic status masks.

How It Works

Syncr uses a decoupled two-layer infrastructure:

Firefox Tab [universal.js + Scraper Engine v2]
  │ (Parses DOM / URLs via declarative scraper.json configurations)
  ▼
Background Script [background.js]
  │ (Manages active streams and forwards payloads via Native Messaging)
  ▼
Native Messaging Host [syncr-host.exe / host.sh]
  │ (Formats data using the Syncr Host SDK)
  ▼
Discord Desktop Client (Displays Rich Presence on your profile)

Hot-Update Architecture

To avoid frequent browser extension store submittals, activity rules (scraper.json) and formatting engines (presence.js) are decoupled from the core runtime. The browser extension reads updated scrapers from GitHub, and the native host pulls down matching presence updates locally when a user selects Check for updates.


Repository Structure

Syncr/
├── extension/                   # Browser extension source (Ships in XPI)
│   ├── background/             # Native messaging router & remote index
│   ├── popup/                  # User interface toggles & manual update triggers
│   └── activities/             # Scraper Engine v2 runtime (activity data lives in DSyncr/activities)
├── native-host/                 # Node.js native messaging backend (Bundled in EXE/Installer)
├── launcher/                    # Electron app (Windows Tray, installer, & environment setup)
├── windows.ps1 / linux.sh       # Unified local compilation orchestration scripts
└── update.ps1 / install-linux.sh # Production packaging & native routing scripts


Local Development & Compilation

Use the below scripts to test & compile locally.

1. Execute via Bun (Recommended)

Run the automated pipeline out of the project root:

  • Windows: bun run dev:windows
  • Linux: bun run dev:linux

2. Manual Invocation

Run the compiler files directly from your terminal interface:

  • Windows (PowerShell): .\windows.ps1
  • Linux (Bash): chmod +x linux.sh && ./linux.sh

Contributing Activities

Activity definitions live in the separate DSyncr/activities repository. New integrations require zero core browser extension updates — you only author declarative scraper rules and map them to a Discord application client.

Quick Checklist

  1. Fork & Branch: Fork DSyncr/activities and create a feature branch.
  2. Assign Activity ID: Use a lowercase slug (e.g., reddit, youtube-music).
  3. Register Discord Client ID: Create an application at discord.com/developers to obtain a testing clientId. Upload image assets under Rich Presence -> Art Assets matching the asset keys used in your code.
  4. Create Activity Files in the activities repo:
  • extension/activities/{id}/metadata.json (Declare patterns, origins, and set scraper: "remote")
  • extension/activities/{id}/scraper.json (Author declarative when, extract, and emit properties)
  • native-host/activities/{id}/presence.js (Format the Discord status layout via the Syncr SDK)
  1. Wire Registry: Add your activity ID into extension/activities/registry.json.
  2. Verify Locally: Run node scripts/validate-scraper.js from this repo (with the activities repo cloned as a sibling), then test in Firefox via about:debugging.

Release Pipeline (Maintainers Only)

The release environment splits tasks based on internal engine boundaries:

  • Scraper / Presence Updates: Merge changes into DSyncr/activities main. Client systems automatically pull modifications from that repository.
  • Core Changes: When altering the native wrapper or extension core, bump systemic version manifests and run production compilation pipelines:
# Local automated deployment & distribution
.\update.ps1

# Host binary adjustments only
.\update.ps1 -HostOnly

# Complete automated GitHub Release tagging (Recommended)
bun run githubrelease

About

Your web activity, live on Discord.

Topics

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages