···1+## frontpage.fyi Firefox extension
2+3+This repository provides a Firefox WebExtension that lets you share the current tab to [frontpage.fyi](https://frontpage.fyi) with minimal effort.
4+Links are submitted by creating `fyi.unravel.frontpage.post` records on your ATProto account, the same mechanism the official Frontpage site uses.
5+6+> ℹ️ The Frontpage source code lives at <https://tangled.org/did:plc:klmr76mpewpv7rtm3xgpzd7x/frontpage>.
7+8+### Features
9+10+- Pop-up form that auto-fills the active tab’s title and URL.
11+- Title length indicator (120 characters, matching the Frontpage UI).
12+- Background service worker handles ATProto login, token refresh, and record creation.
13+- Options page for storing your handle, app password, and optional PDS override.
14+- Convenience links to open frontpage.fyi or the options page from the pop-up.
15+16+### Repository layout
17+18+```
19+extension/
20+├── background.js # Service worker for auth + ATProto requests
21+├── manifest.json # Manifest V3 definition
22+├── options.html/js # Credential management UI
23+├── popup.html/js # Submission UI
24+└── styles.css # Shared styling for popup and options
25+```
26+27+### Prerequisites
28+29+- An ATProto account that Frontpage can read.
30+- An app password for that account (create one at <https://bsky.app/settings/app-passwords> or via your own PDS).
31+32+### Load the add-on in Firefox
33+34+1. Open `about:debugging#/runtime/this-firefox`.
35+2. Click **Load Temporary Add-on…** and choose `manifest.json` inside the `extension/` directory.
36+3. Pin the “Frontpage” toolbar button if you want quick access.
37+38+### Configure credentials
39+40+1. Open the add-on pop-up and press the gear icon (or use `about:addons` → **Preferences**).
41+2. Enter your handle and app password. Supply a PDS URL only if you run a custom server.
42+3. Click **Save credentials**. A success message confirms that the session tokens are stored locally.
43+4. Use **Log out** at any time to remove stored tokens (you can also revoke the app password server-side).
44+45+### Submit a link
46+47+1. Browse to the page you want to share.
48+2. Open the Frontpage pop-up; the title and URL are pre-filled.
49+3. Adjust the text if necessary and click **Post to Frontpage**.
50+4. On success, the pop-up reports the record URI returned by `com.atproto.repo.createRecord`.
51+52+### Implementation notes
53+54+- The background worker discovers the user’s PDS by resolving the handle (`com.atproto.identity.resolveHandle` + PLC lookup).
55+- Sessions are refreshed automatically via `com.atproto.server.refreshSession` when the access JWT expires.
56+- All data stays in `browser.storage.local`; nothing is transmitted to third-party services beyond the ATProto endpoints.
57+- Maximum lengths follow the current Frontpage limits (120 characters for the title, 2048 for URLs).
58+59+### Development tips
60+61+- Inspect background/service-worker logs from `about:debugging` → **Inspect**.
62+- The UI scripts (`popup.js` and `options.js`) log to the DevTools console attached to their respective documents.
63+- When packaging for distribution, zip the contents of the `extension/` directory.