Skip to content

feat(extension): browser extension core for Chrome and Firefox#1

Open
oxr463 wants to merge 3 commits into
mainfrom
feat/browser-extension-core
Open

feat(extension): browser extension core for Chrome and Firefox#1
oxr463 wants to merge 3 commits into
mainfrom
feat/browser-extension-core

Conversation

@oxr463

@oxr463 oxr463 commented May 25, 2026

Copy link
Copy Markdown
Collaborator

Issue number: resolves FindFirst-Development/FindFirst-core#417


Checklist

  • Code Formatter (run prettier/spotlessApply)
  • Code has unit tests? (If no explain in other_information)
  • Builds on localhost
  • Builds/Runs in docker compose

What is the current behavior?

There is no browser extension. Users must navigate to the FindFirst web app, manually enter a URL and title, and select tags to save a bookmark; interrupting their browsing flow.

The repository contained only a non-functional Firefox Manifest V2 stub and an empty Chrome directory.

What is the new behavior?

  • One-click save — popup lets users save the current tab's URL and title to FindFirst without leaving the page
  • Tag support — autocomplete from existing tags; create new tags inline during save
  • Context menu — right-click any page or link to save it directly
  • Options page — configure FindFirst server base URL and view connection status; supports any self-hosted instance
  • Auth flow — sign in from within the extension; accessToken (JWT) read from the sign-in response body and stored in browser.storage.local; sent as Authorization: Bearer on all API calls; session persists across popup close/open for the lifetime of the JWT
  • Dual-browser support — single shared TypeScript source tree (src/) builds separate Chrome MV3 (dist/chrome/) and Firefox MV3 (dist/firefox/) artifacts via esbuild
  • 28 unit tests — covering the API client, storage helpers, tag logic, and URL validation (Vitest)

Does this introduce a breaking change?

  • Yes
  • No

Other information

Firefox manifest: Firefox MV3 uses background.scripts (array) rather than background.service_worker. The build produces browser-specific manifests from manifests/manifest.firefox.json and manifests/manifest.chrome.json.

CORS: The FindFirst API server allows chrome-extension://* and moz-extension://* origins — handled in FindFirst-Development/FindFirst-core#418.

Server dependency: This PR requires the server-side changes in FindFirst-Development/FindFirst-core#418, which adds accessToken to the sign-in response and wires up Bearer token authentication.

Docker Compose: The extension is a static build artifact loaded directly into the browser — it does not run as a container.

Screenshot 2026-05-24 at 7 04 39 PM Screenshot 2026-05-24 at 7 05 49 PM Screenshot 2026-05-24 at 7 07 06 PM Screenshot 2026-05-24 at 7 07 31 PM Screenshot 2026-05-24 at 7 12 10 PM Screenshot 2026-05-24 at 7 13 12 PM

oxr463 added 2 commits May 23, 2026 11:16
Introduces a shared TypeScript source tree that builds separate Chrome and
Firefox (Manifest V3) artifacts via esbuild. Includes background service
worker with message-passing API, popup UI with tag chips and autocomplete,
options page with server URL config and connection status, and 28 unit tests
covering the shared API client, storage helpers, tag logic, and URL validation.

Replaces the old Firefox Manifest V2 stub; icons moved to src/icons/.
- Change default server URL to localhost:9000 (API server port)
- Fix Firefox manifest: use background.scripts instead of service_worker
- Add cookies permission to both manifests; update host_permissions to port 9000
- Store JWT in extension storage after signin and send as Bearer token to
  work around Chrome's SameSite=Lax blocking cookies from chrome-extension://
  origins on cross-origin requests
@oxr463 oxr463 requested a review from R-Sandor May 25, 2026 01:09
@oxr463 oxr463 self-assigned this May 25, 2026
@oxr463 oxr463 added the enhancement New feature or request label May 25, 2026
- Switch Firefox manifest from service_worker to scripts array;
  Firefox MV3 uses scripts not service_worker (supported from v109)
- Fix host_permissions port 8080 -> 9000, add findfirst.dev
- Store accessToken from sign-in response in browser.storage.local
  so the session persists across popup close/open for the JWT lifetime
- Send Authorization: Bearer header on all API calls instead of
  relying on cookies which are not accessible from extension origins
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Browser extension for one-click bookmarking from Chrome and Firefox

1 participant