feat(extension): browser extension core for Chrome and Firefox#1
Open
oxr463 wants to merge 3 commits into
Open
feat(extension): browser extension core for Chrome and Firefox#1oxr463 wants to merge 3 commits into
oxr463 wants to merge 3 commits into
Conversation
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
- 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue number: resolves FindFirst-Development/FindFirst-core#417
Checklist
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?
accessToken(JWT) read from the sign-in response body and stored inbrowser.storage.local; sent asAuthorization: Beareron all API calls; session persists across popup close/open for the lifetime of the JWTsrc/) builds separate Chrome MV3 (dist/chrome/) and Firefox MV3 (dist/firefox/) artifacts via esbuildDoes this introduce a breaking change?
Other information
Firefox manifest: Firefox MV3 uses
background.scripts(array) rather thanbackground.service_worker. The build produces browser-specific manifests frommanifests/manifest.firefox.jsonandmanifests/manifest.chrome.json.CORS: The FindFirst API server allows
chrome-extension://*andmoz-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
accessTokento 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.