You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -28,9 +28,10 @@ This section summarizes the current `Development` branch compared with `main` as
28
28
- Split the oversized service-worker regression file into focused core, EasyEDA, direct SamacSys, and Firefox SamacSys test files backed by a shared harness.
29
29
- Reworked the popup into a provider-aware UI that shows fixed manufacturer metadata plus source-specific part metadata and advanced SamacSys/Firefox settings.
30
30
- Moved persistent download layout, Firefox relay, and SamacSys auth settings from the popup into a dedicated extension settings page.
31
-
- Grouped Firefox helper and captured-sign-in controls into a Firefox-only advanced settings menu.
31
+
- Grouped Firefox helper controls into a Firefox-only advanced settings menu.
32
32
- Added explicit `Save` and `Discard` controls to the settings page.
33
33
- Made helper tokens and SamacSys passwords session-only by default, with explicit remember-on-this-device opt-ins and warning copy.
Copy file name to clipboardExpand all lines: SECURITY.md
+1-4Lines changed: 1 addition & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,12 +26,9 @@ The extension stores ordinary settings in `chrome.storage.local`. That storage c
26
26
27
27
- the optional Firefox SamacSys relay URL
28
28
- remember-on-this-device flags for optional secrets
29
-
- an optional manual upstream SamacSys `Authorization` override
30
29
- accumulated KiCad symbol-library text used for library-mode exports
31
30
32
-
The optional Firefox helper password/token and optional SamacSys username/password are stored in `chrome.storage.session` by default, so they are kept only for the current browser session. They are copied to `chrome.storage.local` only when the user explicitly ticks the matching `Remember ... on this device` box after reading the warning in the settings page.
33
-
34
-
The latest Firefox-captured upstream SamacSys `Authorization` header is stored in `chrome.storage.session` and treated as short-lived session data. The extension ignores captured auth values older than one hour.
31
+
The optional Firefox authentication token and optional SamacSys username/password are stored in `chrome.storage.session` by default, so they are kept only for the current browser session. They are copied to `chrome.storage.local` only when the user explicitly ticks the matching `Remember ... on this device` box after reading the warning in the settings page.
35
32
36
33
Relay auth and upstream SamacSys auth are intentionally separate. The relay auth header is sent only to the configured user-managed relay. Upstream SamacSys auth is sent only to SamacSys or inside a relay payload that asks the relay to contact SamacSys.
Copy file name to clipboardExpand all lines: contributing.md
+36Lines changed: 36 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,11 +27,47 @@ For SamacSys-backed pages, note whether previews worked, whether ZIP export fail
27
27
28
28
## Development setup
29
29
30
+
Use Node `22.13.0+` recommended, Node `20.19.0+`, or Node `24+`. Node `21.x` is not supported by the current Vitest/Vite/jsdom stack.
31
+
30
32
1. Clone the repository.
31
33
2. Install dependencies with `npm install`.
32
34
3. Load the extension unpacked in Chrome or temporarily in Firefox.
33
35
4. Run `npm run validate` before finalizing changes.
34
36
37
+
The repository includes `.nvmrc` for the recommended Node version.
38
+
39
+
## Manual extension loading
40
+
41
+
Chrome:
42
+
43
+
1. Open `chrome://extensions`.
44
+
2. Enable `Developer mode`.
45
+
3. Click `Load unpacked`.
46
+
4. Select the repository root that contains `manifest.json`.
47
+
48
+
Firefox:
49
+
50
+
1. Open `about:debugging#/runtime/this-firefox`.
51
+
2. Click `Load Temporary Add-on`.
52
+
3. Select `manifest.json` from the repository root.
53
+
54
+
The development manifest expects Firefox `121+` so Firefox can use the background-document fallback while Chrome uses the Manifest V3 service worker.
55
+
56
+
## Local validation
57
+
58
+
Run the local checks with:
59
+
60
+
```bash
61
+
npm install
62
+
npm run lint
63
+
npm test
64
+
npm run validate
65
+
```
66
+
67
+
`npm run validate` runs linting, the Vitest regression suite, a moderate-severity dependency audit, and whitespace checks. CI uses `npm ci` and the same validation script on the supported Node lines.
68
+
69
+
The Vitest suite includes a history-wide security hygiene check. It is meant for full validation, CI, security cleanup, and before sharing pushed history; it does not need to be run manually for every intermediate local commit while iterating.
70
+
35
71
Use `README.md` for the operator-facing overview. Use `systemDesign.md` for the implemented design and `docs/architecture-notes.md` for short implementation notes.
-`src/settings_page.js`: persistent download layout plus session-first SamacSys auth settings and Firefox-only advanced helper settings
10
10
-`src/service_worker.js`: thin runtime entrypoint only
11
-
-`src/service_worker_runtime.js`: provider routing, runtime gating, Firefox SamacSys auth capture, automatic auth-refresh orchestration, response shaping, and composition of worker dependencies
11
+
-`src/service_worker_runtime.js`: provider routing, runtime gating, response shaping, and composition of worker dependencies
12
12
-`src/core/*.js`: shared worker business logic for settings, downloads, storage-backed symbol-library handling, shared export artifact writing, and common normalization
13
13
-`src/sources/*.js`: source adapters plus source-specific fetch/parse/export helpers
14
14
-`src/sources/samacsys_distributor_adapter.js` is the shared backend adapter for Mouser and Farnell
@@ -35,12 +35,10 @@ This file records short implementation notes that supplement, but do not replace
35
35
- SamacSys distributor support is still Chrome-first, but Firefox can opt into a user-managed relay through the advanced Firefox settings menu.
36
36
- Chrome direct SamacSys ZIP export now retries once with configured upstream auth after a `401`, but preview requests still use the normal direct browser session without preemptive auth headers.
37
37
- Firefox relay mode forwards matching `componentsearchengine.com` cookies so authenticated SamacSys ZIP downloads can reuse the browser session instead of teaching the relay to log in.
38
-
- Firefox relay mode can also generate the upstream SamacSys HTTP Basic auth header locally from optional username/password credentials, avoiding any dependency on a browser-captured header when the user prefers that setup.
38
+
- Firefox relay mode can also generate the upstream SamacSys HTTP Basic auth header locally from optional username/password credentials.
39
39
- Optional helper tokens and SamacSys passwords are session-only by default; the settings page requires explicit opt-in before remembering them in browser local storage.
40
-
- Firefox now stores the latest observed upstream SamacSys `Authorization` header through `webRequest` as short-lived session data and reuses it for proxied Firefox requests until a newer one is captured or it expires.
41
40
- Relay auth and upstream SamacSys auth are separate: relay auth is sent only on the Worker POST, while upstream auth is forwarded inside the relay payload.
42
41
- SamacSys ZIP-export `401` responses are mapped to a sign-in-required error because upstream authentication can be stricter for downloads than for previews.
43
-
- On Firefox relay mode, one failed SamacSys ZIP export can trigger a single auth-refresh attempt, then a single retry with the newly captured upstream auth.
44
42
- SamacSys ZIP extraction treats `KiCad/` and `3D/` directories as valid whether they appear at the archive root or under a part-specific parent folder.
45
43
- The current repository is intentionally compact; add new sources through focused adapters or distributor detection changes rather than introducing a broader application framework.
46
44
- The manifest intentionally declares both `background.service_worker` and `background.scripts` so Chrome can run the service worker while Firefox falls back to a background document on Firefox 121+.
0 commit comments